Support Forum

Please note that this forum is only available to you in read only mode. In order to contribute to this conversation you will need to renew your subscription.

Pre-select sidebar menu item

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Hi Paul,
I have a sidebar menu on a few of my pages. You get to these pages by browsing from a main menu link. When the page opens, the first item in the sidebar menu is current - it is what is showing on the page. How can I tell the sidebar menu that it's first item is active when a user first browses to the page?

See brilleneyes.cloudapp.net and browse to Collections\Dutz, for example.

I have used code in custom.css to highlight hover and selected items as follows:

/* collection module menus display of active link */
#mainWrap .sidebar ul.nav > li > a:hover,
#mainWrap .sidebar ul.nav > li span.nav-header:hover {
color: white;
background: #CACCB6;
}
#mainWrap .sidebar ul.nav > li.active > a,
#mainWrap .sidebar ul.nav > li.active span.nav-header {
color: white;
background: #607890;
}

Thanks!
  • Patricia Lawson's Avatar
  • Patricia Lawson
  • 12 Month basic
  • 285 posts
  • 1 Thanks
  • Karma: 1
The administrator has disabled public write access.
If I'm looking at the right page there is no active page on the sidebar

Its the collection Dutz page which is active on the main menu

There is the module title which is in bold

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
Hi Paul,
Yes, it is the Dutz collection which is active on the main menu. When I click on the main menu item Dutz, it takes me to the article index.php?option=com_content&view=article&id=4.
This is exactly where clicking on the first item of the sidebar menu will take me. I just want to let users know that that is where they are - on Dutz Stainless Steel, and I want to indicate that by showing the sidebar menu as active.
Is there a way to tell the sidebar menu item that it is active?
Thanks, as always,
Pat
  • Patricia Lawson's Avatar
  • Patricia Lawson
  • 12 Month basic
  • 285 posts
  • 1 Thanks
  • Karma: 1
The administrator has disabled public write access.
Hi Pat,

You could use an alias for the link type on one of the links
but that would mean both are active

Using alias is under system links in menu type

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
Both being active is fine. Can you point me to some info on how to actually do this? I don't quite get what you are saying....
  • Patricia Lawson's Avatar
  • Patricia Lawson
  • 12 Month basic
  • 285 posts
  • 1 Thanks
  • Karma: 1
The administrator has disabled public write access.
Basically its using one link twice - you tell it what link you want it to use/copy

Key thing to bear in mind is the real link has the modules assigned to it

docs.joomla.org/Help25:Menus_Menu_Item_Menu_Item_Alias
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
sorry forgot to say this for Joomla 2.5 but is still valid

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
Thanks a lot, Paul! I am a bit of a newbie and I worked on this silly thing for a long time without success - and it was so easy! Thanks for your help. ;)
  • Patricia Lawson's Avatar
  • Patricia Lawson
  • 12 Month basic
  • 285 posts
  • 1 Thanks
  • Karma: 1
The administrator has disabled public write access.
No problem

Its not something people actually use that much and its really helpful

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.
Another thing you might want to look at is added a note to the link that is the alias

So to avoid confusion later on

Cheers
Paul
  • manh's Avatar
  • manh
  • Moderator
  • 45248 posts
  • 2106 Thanks
  • Karma: 603
The administrator has disabled public write access.

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Happy Campers