Jump to content

Dropdown Menu with SubMenu - Too long - Smarty, PHP, Prestashop, HTML5


jmauclair

Recommended Posts

I'm trying to implement a solution on my website for our new system, but Im' facing a little issue :(

My issue is the following, I've got a dropdown menu which, on hover, will open an other dropdown menu, in link with element hover.

The issue is that the second dropdown menu can be quiet long (depending of the element hover).

Here my .tpl file :

 

<div class="leo-widget" data-id_widget="{$id_widget}">
    {if isset($subcategories)}
        <div class="widget-subcategories">
            {if isset($widget_heading)&&!empty($widget_heading)}
                <div class="widget-heading">
                    {$widget_heading}
                </div>
            {/if}
            <div class="widget-inner">
                {if $cat->id_category != ''}
                    <div class="menu-title">
                        <a href="{$link->getCategoryLink($cat->id_category, $cat->link_rewrite)|escape:'htmlall':'UTF-8'}"
                            title="{$cat->name|escape:'htmlall':'UTF-8'}">
                            {$cat->name|escape:'htmlall':'UTF-8'}
                        </a>
                    </div>

                    <ul>
                        {foreach from=$subcategories item=subcategory}
                            <li class="clearfix {if isset($subcategory.subsubcategories)}level2 dropdown{/if}">
                                <a href="{$link->getCategoryLink($subcategory.id_category, $subcategory.link_rewrite)|escape:'htmlall':'UTF-8'}"
                                    title="{$subcategory.name|escape:'htmlall':'UTF-8'}">
                                    <span class="sub_cat_name">{$subcategory.name|escape:'htmlall':'UTF-8'} </span>
                                </a>
                                {if isset($subcategory.subsubcategories) && $subcategory.subsubcategories}
                                    <b class="caret {if $level3_only_mobile}hidden-md-up{/if}"></b>
                                    <ul class="dropdown-sub dropdown-menu {if $level3_only_mobile}hidden-md-up" {/if}>
                                        {foreach from=$subcategory.subsubcategories item=subsubcategory}
                                            <li class="clearfix level3">
                                                <a href="{$link->getCategoryLink($subsubcategory.id_category, $subsubcategory.link_rewrite)|escape:'htmlall':'UTF-8'}"
                                                    title="{$subsubcategory.name|escape:'htmlall':'UTF-8'}" class="img">
                                                    {$subsubcategory.name|escape:'htmlall':'UTF-8'}
                                                </a>
                                            </li>
                                        {/foreach}
                                    </ul>
                                {/if}
                            </li>
                        {/foreach}
                    </ul>

                {else}
                    <div class="alert alert-warning">
                        {l s='The ID category does not exist' mod='leobootstrapmenu'}
                    </div>
                {/if}
            </div>
        </div>
    {/if}
</div>

It's from leobootstrapmenu, I've made some modifications to have sub sub categories.

Here is a video to show you the issue :

https://streamable.com/l2rk9f

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...