prestashop top menu

10,305

Solution 1

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

Solution 2

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

Share:
10,305
zied.hosni
Author by

zied.hosni

I am self motivated and highly experienced web developer. I built HTML5 Ninja http://html5-ninja.com a marketplace where authors & designers propose their creations (themes, scripts... ) for selling.

Updated on June 14, 2022

Comments

  • zied.hosni
    zied.hosni almost 2 years

    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">&nbsp;</div>
    
        <!--/ Menu -->
    {/if}
    

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