Reputation: 490
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?
Upvotes: 2
Views: 10335
Reputation: 490
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
Upvotes: 1
Reputation: 1775
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
Upvotes: 1