Author Topic: Question about "sticky" option of menu within SM2 in WB  (Read 462 times)

Offline rumen

  • Posts: 424
Question about "sticky" option of menu within SM2 in WB
« on: June 11, 2020, 08:17:05 AM »
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:

Code: [Select]
<?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">'
);?>

Offline dbs

  • Betatester
  • **
  • Posts: 8399
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: Question about "sticky" option of menu within SM2 in WB
« Reply #1 on: June 11, 2020, 09:33:25 AM »
Hi, if you want use own scripts like
Code: [Select]
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>You have to deactivate the line
Code: [Select]
register_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_m odfiles('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.

Offline rumen

  • Posts: 424
Re: Question about "sticky" option of menu within SM2 in WB
« Reply #2 on: June 11, 2020, 10:20:30 AM »
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.

Offline LudwigSt

  • Posts: 328
Re: Question about "sticky" option of menu within SM2 in WB
« Reply #3 on: June 11, 2020, 11:24:15 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.
Wissen ist Macht - aber nix wissen macht auch nix.

Offline dbs

  • Betatester
  • **
  • Posts: 8399
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: Question about "sticky" option of menu within SM2 in WB
« Reply #4 on: June 11, 2020, 11:31:23 AM »
Maybe it was a misunderstanding.
Not deactivate your line with jquery-2.2.4.
Deactivate the line
Code: [Select]
register_frontend_modfiles('jquery');
The order of the scripts is important.
First jQuery, then the rest of the JS.

Offline rumen

  • Posts: 424
Re: Question about "sticky" option of menu within SM2 in WB
« Reply #5 on: June 11, 2020, 04:10:15 PM »
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.

Offline rumen

  • Posts: 424
Re: Question about "sticky" option of menu within SM2 in WB
« Reply #6 on: June 11, 2020, 08:13:43 PM »
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

Offline dbs

  • Betatester
  • **
  • Posts: 8399
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: Question about "sticky" option of menu within SM2 in WB
« Reply #7 on: June 11, 2020, 09:08:01 PM »
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.

Offline rumen

  • Posts: 424
Re: Question about "sticky" option of menu within SM2 in WB
« Reply #8 on: June 12, 2020, 01:20:12 AM »
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>

Offline dbs

  • Betatester
  • **
  • Posts: 8399
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: Question about "sticky" option of menu within SM2 in WB
« Reply #9 on: June 12, 2020, 07:52:19 AM »
Try this (seen here https://get.foundation/sites/docs/dropdown-menu.html)
           
Code: [Select]
<?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>'
            
);?>

Offline rumen

  • Posts: 424
Re: Question about "sticky" option of menu within SM2 in WB
« Reply #10 on: June 12, 2020, 10:18:06 AM »
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.

Offline rumen

  • Posts: 424
Re: Question about "sticky" option of menu within SM2 in WB
« Reply #11 on: June 12, 2020, 10:30:58 AM »
OK I found the issue with the vertical menu in mobile version it is the additional class in the UL  here i sthe menu:

Code: [Select]
<?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!

Offline dbs

  • Betatester
  • **
  • Posts: 8399
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: Question about "sticky" option of menu within SM2 in WB
« Reply #12 on: June 12, 2020, 12:04:45 PM »
Good job, it works.  (Y)

 

postern-length