Add attributes to Menu Item

For Joomla! 3.x Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general

Moderator: ooffick

Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
Locked
jonBuckner1
Joomla! Explorer
Joomla! Explorer
Posts: 428
Joined: Mon Nov 12, 2012 9:08 am

Add attributes to Menu Item

Post by jonBuckner1 » Sun May 08, 2016 6:21 am

Hi folks

I've looked and searched but I keep going round in circles.

I am wanting to add attributes to menu items, in particular 'External URL'.

There is the option to add a value to the title attribute, but it would have been great jut to be able to add ANY attribute...

Anybody have any tips, suggestions etc

Please and thanks

Jon

 
User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 39055
Joined: Sat Apr 05, 2008 9:58 pm

Re: Add attributes to Menu Item

Post by Webdongle » Sun May 08, 2016 8:32 am

Your definition of 'Attribute' please
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"The definition of insanity is doing the same thing over and over again, but expecting different results": Albert Einstein.

jonBuckner1
Joomla! Explorer
Joomla! Explorer
Posts: 428
Joined: Mon Nov 12, 2012 9:08 am

Re: Add attributes to Menu Item

Post by jonBuckner1 » Sun May 08, 2016 11:03 am

Hi webdongle

I'm thinking along the lines of BS3 and modals...

This would mean data-toggle="modal" data-target="#my-module-in-modal"

I have seen how to create a new menu item and then apply settings to the page... but, not how to configure that menu item with custom options that apply to the actual menu item.

Maybe I can do an override of External URL, but so far the method has eluded me

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 39055
Joined: Sat Apr 05, 2008 9:58 pm

Re: Add attributes to Menu Item

Post by Webdongle » Sun May 08, 2016 11:51 am

Menu item type External url allows for suffixes to be added to the url ... you can set relative rather than your whole site url.

Menu class suffix allows for css specific to the page the menu item displays
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"The definition of insanity is doing the same thing over and over again, but expecting different results": Albert Einstein.

jonBuckner1
Joomla! Explorer
Joomla! Explorer
Posts: 428
Joined: Mon Nov 12, 2012 9:08 am

Re: Add attributes to Menu Item

Post by jonBuckner1 » Thu May 19, 2016 5:40 am

Hi

But not add attributes to menu item...

Except by using javascript to do this.

That said, adding to url is a nifty feature.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 39055
Joined: Sat Apr 05, 2008 9:58 pm

Re: Add attributes to Menu Item

Post by Webdongle » Thu May 19, 2016 9:44 am

To open the target (Article/external url) in a modal window by clicking a menu item ... can be done. I do it with JCE Editor and mediabox and use their class in the Menu's class suffix
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"The definition of insanity is doing the same thing over and over again, but expecting different results": Albert Einstein.

jonBuckner1
Joomla! Explorer
Joomla! Explorer
Posts: 428
Joined: Mon Nov 12, 2012 9:08 am

Re: Add attributes to Menu Item

Post by jonBuckner1 » Mon Jul 11, 2016 2:51 am

Hi, and thanks

Hmmm, interesting.

Be good to have attributes option in menu item, I'll leave it at that. For the minute, alternative tricks required :)

 

Locked

Return to “Joomla! 3.x Coding”