Question about "sticky" option of menu within SM2 in WB

dbs

[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

rumen

OK I found the issue with the vertical menu in mobile version it is the additional class in the UL  here i sthe menu:

<?php 
            $open 
'<li class="[class]"><a href="[url]">[menu_title]</a>';
            
            echo 
show_menu2(
                
$aMenu          1,
                
$aStart         SM2_ROOT+$iMultiLang
                
$aMaxLevel      SM2_CURR+2,
                
$aOptions       SM2_ALL,
                
$aItemOpen      $open,
                
$aItemClose     '</li>',
                
$aMenuOpen      '<ul class="menu">',
                
$aMenuClose     '</ul>',
                
$aTopItemOpen   false,
                
$aTopMenuOpen   '<ul class="vertical medium-horizontal menu" data-responsive-menu="accordion medium-dropdown" >'
            
);?>


Now it works perfect!

rumen

I confirm it work! Just note - if anyone use the template should not put more then 4 things in the menu!!! The mobile menu doesn't transform the menu from horizontal to vertical and if there are more then 4 or 5 things they go out of the page. Look here

Everything else works fine! In the video the button of the "MENU" in the mobile version doesn't change properly but that's only in the video maybe a conflict with the video recording application.

dbs

Try this (seen here https://get.foundation/sites/docs/dropdown-menu.html)
            <?php 
            $open 
'<li class="[class]"><a href="[url]">[menu_title]</a>';
            
            echo 
show_menu2(
                
$aMenu          1,
                
$aStart         SM2_ROOT+$iMultiLang
                
$aMaxLevel      SM2_CURR+2,
                
$aOptions       SM2_ALL,
                
$aItemOpen      $open,
                
$aItemClose     '</li>',
                
$aMenuOpen      '<ul class="menu">',
                
$aMenuClose     '</ul>',
                
$aTopItemOpen   false,
                
$aTopMenuOpen   '<ul class="dropdown menu" data-dropdown-menu>'
            
);?>
[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

rumen

Line 2158 to 2408 in the CSS file - foundation.css (attached in the zip file I uploaded early) is the dropdown menu. Active with <li>

dbs

You have a link to the original site where dropdown works?
For me it looks like no function for dropdown is implemented.
Only sticky menu is present. And a toggle class for the mobile menu button.
[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

rumen

Attached the template. Only dropdown doesn't work. If anyone find the problem - please share to correct.

Thanks dbs for the help!

Appreciate!

Regards,

Rumen

rumen

Yep! Now the "sticky" function works. Only the dropdown should be fixed. I can upload it like that now the full here (as template with index.php, info.php, CSS and JS) so everyone can download, but need to fix the dropdown. I have no idea why doesn't work. Probably some of the classes ... The CSS is based on "foundation" and it is full - has grid, buttons, tables etc ... need small customization as needs of the site.

dbs

Maybe it was a misunderstanding.
Not deactivate your line with jquery-2.2.4.
Deactivate the lineregister_frontend_modfiles('jquery');

The order of the scripts is important.
First jQuery, then the rest of the JS.
[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

LudwigSt

Quote from: rumen on June 11, 2020, 08:17:05 AM
but whatever I try I loose the dropdown and the sticky. 
The css classes of everything belonging to the dropdown are not declared, as far as I can see on the first look.
LG Ludwig

Wissen ist Macht - aber nix wissen macht auch nix.

rumen

Hi there,

I sent the original files, in the system I have all that in place see here and here.

It is free menu script and looks nice. Anyone can use it and that's why I try to make it works, so any of us here can use it some day if need. So far unfortunately no any success.

dbs

Hi, if you want use own scripts like
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>You have to deactivate the lineregister_frontend_modfiles('jquery');And you have to check the filter "RegisterModFiles" in Admin-Tools > Output Filter Frontend

It is not easy to use, i know.
Check the checkbox "RegisterModFiles" means:
- use the template like in old times.
- ignore the filter "Jquery".
- Use the register_frontend_modfiles('xxx') in the index.php.
Mouseover on this filter should display some more informations.

In this moment it looks for me so: you haven't checked the checkbox RegisterModFiles. The filter Jquery is checked and load jQuery.Also your line with jquery-2.2.4 is active. So you have 2 times jquery loaded, and this is not good.
Hope it helps.
[url="https://onkel-franky.de"]https://onkel-franky.de[/url]

rumen

Hi there,

I wounder if I can use a "sticky" menu option in WB and I try on good menu, but whatever I try I loose the dropdown and the sticky.  Attached all files.  I try many hours to make it but can't make it work until now. The code last try is:

<?php 
$open '<li class="[if(class=menu-parent){active}]'
                
.   '[if(class==menu-expand){hassubs}]">'
                
.   '[if(class==menu-expand)'
                    
.   '{<a href="[url]" class="">[menu_title]<b class="caret"></b> <i class="fa fa-chevron-down"></i></a>}'
                
'else'
                    
.   '{<a href="[url]">[menu_title]</a>}'
                
']';
echo show_menu2(
$aMenu          1,
$aStart         SM2_ROOT+$iMultiLang
$aMaxLevel      SM2_CURR+2,
$aOptions       SM2_ALL|SM2_PRETTY,
$aItemOpen      $open,
$aItemClose     '</li>',
$aMenuOpen      '<ul>',
$aMenuClose     '</ul>',
$aTopItemOpen   false,
$aTopMenuOpen   '<ul class="menu vertical medium-horizontal">'
);?>