Jump to content

Mainmenu brands with images


Recommended Posts

Hi, what would be a more elegant way to have brand images in menu? As you can see I came up with a very crude way and I wanted to improve that part.
 

 <img src="{$urls.img_manu_url}{$node.page_identifier|replace:'manufacturer-':''}-brands_homePage.jpg" alt="{$node.label|escape:'html':'UTF-8'}"/>
                         


 

ps_mainmenu.tpl

{foreach from=$nodes item=node}
            {if  $node.type == 'manufacturer'}
                <li class="{$node.type}{if $node.current} current {/if}" id="{$node.page_identifier}">
                    {assign var=_counter value=$_counter+1}
                    <a
                            class="{if $depth >= 0}dropdown-item{/if}{if $depth === 1} dropdown-submenu{/if}"
                            href="{$node.url}" data-depth="{$depth}"
                            {if $node.open_in_new_window} target="_blank" {/if}
                    >
                                <div class="item">
                                        <img src="{$urls.img_manu_url}{$node.page_identifier|replace:'manufacturer-':''}-brands_homePage.jpg" alt="{$node.label|escape:'html':'UTF-8'}"/>
                                </div>
                    </a>
                    {if $node.children|count}
                        <div {if $depth === 0} class="popover sub-menu js-sub-menu collapse"{else} class="collapse"{/if}
                                id="top_sub_menu_{$_expand_id}">
                            {menu nodes=$node.children depth=$node.depth parent=$node}
                        </div>
                    {/if}
                </li>
            {else}

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...