1. nikowitt
  2. Commercial Templates
  3. Monday, 30 November 2015
  4.  Subscribe via email
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
Accepted Answer Pending Moderation
0
Votes
Undo
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
  1. more than a month ago
  2. Commercial Templates
  3. # 1
Accepted Answer Pending Moderation
0
Votes
Undo
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 :)
  1. more than a month ago
  2. Commercial Templates
  3. # 2
Accepted Answer Pending Moderation
0
Votes
Undo
Thank you

So you wish to disable the accordion style menu and instead display all menu items?

Ciarán
  1. more than a month ago
  2. Commercial Templates
  3. # 3
Accepted Answer Pending Moderation
0
Votes
Undo
The best thing would be to maintain the existing menu behaviour, but to also follow the link.
  1. more than a month ago
  2. Commercial Templates
  3. # 4
Accepted Answer Pending Moderation
0
Votes
Undo
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
  1. more than a month ago
  2. Commercial Templates
  3. # 5
Accepted Answer Pending Moderation
0
Votes
Undo
This solution would be OK for me :)
  1. more than a month ago
  2. Commercial Templates
  3. # 6
Accepted Answer Pending Moderation
0
Votes
Undo
You could try removing the following line from your templates scripts.js (../templates/j51_florence/js/ scripts.js line 7)...


$(this).removeAttr('href');


Clicking the parent item will then follow the link.

Ciarán
  1. more than a month ago
  2. Commercial Templates
  3. # 7
Accepted Answer Pending Moderation
0
Votes
Undo
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)...


// 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
  1. more than a month ago
  2. Commercial Templates
  3. # 8
Accepted Answer Pending Moderation
0
Votes
Undo
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
  1. more than a month ago
  2. Commercial Templates
  3. # 9
Accepted Answer Pending Moderation
0
Votes
Undo
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)...


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
  1. more than a month ago
  2. Commercial Templates
  3. # 10
Accepted Answer Pending Moderation
0
Votes
Undo
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
  1. more than a month ago
  2. Commercial Templates
  3. # 11
Accepted Answer Pending Moderation
0
Votes
Undo
Great. Everything works as expected now. Thank you very much for your help!

Regards,
Niko
  1. more than a month ago
  2. Commercial Templates
  3. # 12
Accepted Answer Pending Moderation
0
Votes
Undo
Excellent! Thank you for the update!

Ciarán
  1. more than a month ago
  2. Commercial Templates
  3. # 13
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!

Join Our Newsletter

* indicates required
We respect your privacy and do not tolerate spam and will never sell, rent, lease or give away your information (name, email, number, etc.) to any third party. Nor will we send you unsolicited email.
Joomla51 - Mullaghmore, Co. Sligo, Ireland
Joomla51.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by
Open Source Matters
the trademark holder in the United States and other countries.

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.

Ok