Hi there,
I want to create a menu entry that expands a sub menu AND links to an article, but only the menu entry is expanded, probably the JS cancels the link. Is there any best practice to achieve this?
Please let me know if further details are required.
Thanks in advance!
Best regards,
Niko
- nikowitt
-
- Commercial Templates
- Monday, 30 November 2015
- Subscribe via email
Hi Niko
Would you have a URL to an example of your menu? Just to confirm, you wish the the entire menu tree to open when the parent item is clicked?
Ciarán
Would you have a URL to an example of your menu? Just to confirm, you wish the the entire menu tree to open when the parent item is clicked?
Ciarán
- more than a month ago
- Commercial Templates
- # 1
Sure:
https://c1.server-was.de/~notfaell/
Entry "Zuhause gesucht" is supposed to open an article and has to expand the submenu.
The page is at a VERY early stage, so please don't take any other issues into account
https://c1.server-was.de/~notfaell/
Entry "Zuhause gesucht" is supposed to open an article and has to expand the submenu.
The page is at a VERY early stage, so please don't take any other issues into account

- more than a month ago
- Commercial Templates
- # 2
Thank you
So you wish to disable the accordion style menu and instead display all menu items?
Ciarán
So you wish to disable the accordion style menu and instead display all menu items?
Ciarán
- more than a month ago
- Commercial Templates
- # 3
The best thing would be to maintain the existing menu behaviour, but to also follow the link.
- more than a month ago
- Commercial Templates
- # 4
Sorry to say that option is not available. If we set your template to follow the link then there would be no way to access the sub menu items? The only option I can think of is to leave your sub items visible at all times.
Ciarán
Ciarán
- more than a month ago
- Commercial Templates
- # 5
You could try removing the following line from your templates scripts.js (../templates/j51_florence/js/ scripts.js line 7)...
Clicking the parent item will then follow the link.
Ciarán
$(this).removeAttr('href');
Clicking the parent item will then follow the link.
Ciarán
- more than a month ago
- Commercial Templates
- # 7
To disable the accordion style menu and instead display all menu items remove the following from your templates scripts.js (../templates/j51_florence/js/ scripts.js line5-22)...
And add the following to the Custom CSS field of your templates parameters....
Ciarán
// Main Menu
$('.hornav li.parent > a').on('click', function(){
$(this).removeAttr('href');
var element = $(this).parent('li');
if (element.hasClass('open')) {
element.removeClass('open');
element.find('li').removeClass('open');
element.find('ul').slideUp();
}
else {
element.addClass('open');
element.children('ul').slideDown();
element.siblings('li').children('ul').slideUp();
element.siblings('li').removeClass('open');
element.siblings('li').find('li').removeClass('open');
element.siblings('li').find('ul').slideUp();
}
});
And add the following to the Custom CSS field of your templates parameters....
.hornav ul ul {
display: block;
}
Ciarán
- more than a month ago
- Commercial Templates
- # 8
Hi Ciarán,
removing the href removal line suits perfectly, I should actually have been able to detect this myself...
EDIT: For the responsive navigation, this does not seem to be enough, is there a corresponding workaround? Some removal property does not exist (at a first glance).
Aside that, I see the both Mootools and JQuery is used, isn't the template supposed to not use Mootools anymore? I'd prefer saving additional 80-90KB on page load
Regards,
Niko
removing the href removal line suits perfectly, I should actually have been able to detect this myself...

EDIT: For the responsive navigation, this does not seem to be enough, is there a corresponding workaround? Some removal property does not exist (at a first glance).
Aside that, I see the both Mootools and JQuery is used, isn't the template supposed to not use Mootools anymore? I'd prefer saving additional 80-90KB on page load

Regards,
Niko
- more than a month ago
- Commercial Templates
- # 9
Hi Niko
Try setting the following in your templates ../templates/j51_enlighten/js/responsive-nav/responsive-nav.js to true which will leave the parent link text clickable (open dropdown by clicking the remainder of the button)...
To ensure Mootools is not loaded you can remove the following from the head of your templates index.php (../templates/[YourTemplate]/index.php - line9)...
Ciarán
Try setting the following in your templates ../templates/j51_enlighten/js/responsive-nav/responsive-nav.js to true which will leave the parent link text clickable (open dropdown by clicking the remainder of the button)...
allowParentLinks: true,
To ensure Mootools is not loaded you can remove the following from the head of your templates index.php (../templates/[YourTemplate]/index.php - line9)...
JHtml::_('behavior.framework', true);
Ciarán
- more than a month ago
- Commercial Templates
- # 10
Thanks, will try that 
Okay, I expected the other way around (that Mootools are not loaded but default but that is has to be explicitely enabled when it is required).
Best regards,
Niko

Okay, I expected the other way around (that Mootools are not loaded but default but that is has to be explicitely enabled when it is required).
Best regards,
Niko
- more than a month ago
- Commercial Templates
- # 11
Great. Everything works as expected now. Thank you very much for your help!
Regards,
Niko
Regards,
Niko
- more than a month ago
- Commercial Templates
- # 12
- Page :
- 1
There are no replies made for this post yet.
Be one of the first to reply to this post!
Be one of the first to reply to this post!
Please login to post a reply
You will need to be logged in to be able to post a reply. Login using the form on the right or register an account if you are new here. Register Here »