0Day Forums
prestashop top menu - Printable Version

+- 0Day Forums (https://zeroday.vip)
+-- Forum: Coding (https://zeroday.vip/Forum-Coding)
+--- Forum: CMS (https://zeroday.vip/Forum-CMS)
+---- Forum: PrestaShop (https://zeroday.vip/Forum-PrestaShop)
+---- Thread: prestashop top menu (/Thread-prestashop-top-menu)



prestashop top menu - jenifferqsotxbdtq - 07-26-2023

I building a theme for prestashop and I would like to change the html structure of the menu.
the actuel top menu is placed under `modules/blocktopmenu/blocktopmenu.tpl`

{if $MENU != ''}
</div>

<!-- Menu -->
<div class="sf-contener clearfix">
<ul class="sf-menu clearfix">
{$MENU}
{if $MENU_SEARCH}
<li class="sf-search noBack" style="float:right">
<form id="searchbox" action="{$link->getPageLink('search')}" method="get">
<p>
<input type="hidden" name="controller" value="search" />
<input type="hidden" value="position" name="orderby"/>
<input type="hidden" value="desc" name="orderway"/>
<input type="text" name="search_query" value="{if isset($smarty.get.search_query)}{$smarty.get.search_query|escape:'htmlall':'UTF-8'}{/if}" />
</p>
</form>
</li>
{/if}
</ul>
<div class="sf-right"> </div>

<!--/ Menu -->
{/if}

How can I edit the `{$MENU}` html structure?


RE: prestashop top menu - jarvisafvgc - 07-26-2023

In the same module, in .php file modules/blocktopmenu/blocktopmenu.php smarty $MENU variable is assigned
`$this->smarty->assign('MENU', $this->_menu);`

So you need to change value of $this->_menu (what is needed to change, because there are a lot of html code in this property) in blocktopmenu.php


RE: prestashop top menu - perihepatic86335 - 07-26-2023

apparently there's no way to edit the top menu without editing the module ,
I find a little solution with smarty `replace` function

something like that

{$HOOK_TOP|replace:'sf-contener':''|replace:'sf-menu':'ftopMenu left'|replace:'id="header_links"':'id="ftopright" class="right"'}

you can also use some jQuery trick