Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menu's may not have the class='active' #3121

Closed
dougransom opened this issue Feb 15, 2014 · 7 comments
Closed

Menu's may not have the class='active' #3121

dougransom opened this issue Feb 15, 2014 · 7 comments

Comments

@dougransom
Copy link

Use a module to display both a top-level menu, and a submenu on certain pages.

The submenu doesn't get the 'class = active' set on the right item. Instead it is set for the parent item (which is also in the child menu). In this case both "investment solutions" on the main menu and "Goals Based Investing" on the child menu refer to the same article.

In this example the user has selected "Portfolio Construction" but in the menu Goals Based Investing is highlighted instead.

investment_solutions-5
portfolio_construction-4

Based on using a templated that is a tweaked protostar template.

here are the two menus html:

                        <nav class="navigation" role="navigation">
                <ul class="nav menu    nav-pills">
<li class="item-101"><a href="/" >Home</a></li><li class="item-112 current active deeper parent"><a href="/investmentsolutions" >Investment Solutions</a><ul class="nav-child unstyled small"><li class="item-132 active"><a href="/investmentsolutions" >Goals Based Investing</a></li><li class="item-128"><a href="/investmentsolutions/portfolio-construction" >Portfolio Construction</a></li><li class="item-129"><a href="/investmentsolutions/investment-cowards" >Investment Cowards</a></li><li class="item-130"><a href="/investmentsolutions/bold-investors" >Bold Investors</a></li><li class="item-131"><a href="/investmentsolutions/business-owners" >Business Owners</a></li></ul></li><li class="item-105"><a href="/productsandservices" >Products and Services</a></li><li class="item-102"><a href="/contact" >Contact</a></li><li class="item-106"><a href="/client-login" >Client Login</a></li><li class="item-108"><a href="/bio" >Bio</a></li><li class="item-120"><a href="/ias" >Industrial Alliance Securities Inc.</a></li></ul>

            </nav>

and


<div class="moduletable_menu">
                    <h3>Investment Solutions</h3>
                    <ul class="nav menu nav-pills">
<li class="item-132 active"><a href="/investmentsolutions" >Goals Based Investing</a></li><li class="item-128"><a href="/investmentsolutions/portfolio-construction" >Portfolio Construction</a></li><li class="item-129"><a href="/investmentsolutions/investment-cowards" >Investment Cowards</a></li><li class="item-130"><a href="/investmentsolutions/bold-investors" >Bold Investors</a></li><li class="item-131"><a href="/investmentsolutions/business-owners" >Business Owners</a></li></ul>
        </div>

Here is the info on my joomla instance:

System Information
Setting Value

PHP Built On Linux box503.bluehost.com 3.4.79-20140208.1.bh6.x86_64 #1 SMP Sat Feb 8 12:29:59 EST 2014 x86_64
Database Version 5.5.36-log
Database Collation utf8_general_ci
PHP Version 5.4.24
Web Server Apache
WebServer to PHP Interface cgi-fcgi
Joomla! Version Joomla! 3.1.5 Stable [ Ember ] 01-August-2013 14:00 GMT
Joomla! Platform Version Joomla Platform 12.2.0 Stable [ Neil Armstrong ] 21-September-2012 00:00 GMT
User Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36

@Sepppl
Copy link

Sepppl commented Apr 20, 2014

Hello,

I have similar problems, but in my case it is not recognized as a bug.
#3480

Have a look at the screenshots. Here everything is correct. In the top-navigation and the sub-navigation aside the same items are highlightened.

screen shot 2014-04-20 at 13 29 04

Here, instead the third level item, as it is highlightened in the top-navi the sub-navi shows
the parent item without the lower level items and without highlightening.

screen shot 2014-04-20 at 13 29 24

If anyone can have a look at it, it is highly appreciated.

Thanks alot,
Seppppl
You may blame the J!Tracker Application for transmitting this comment.

@Sepppl
Copy link

Sepppl commented Apr 20, 2014

Sorry,

here is the system-information:
Joomla 3.2.3
Php 5.3

Module-Settings:
Select Menu: Main Menu
Base-Item: Study
Start-level:2
End-Level: All
Show Sub-Menu Items: Yes
You may blame the J!Tracker Application for transmitting this comment.

@Bakual
Copy link
Contributor

Bakual commented Apr 20, 2014

Can you try with the "base item" as "current"?

@Sepppl
Copy link

Sepppl commented Apr 20, 2014

@Bakual,
thanks for joining in!

I set "base-item" to "current".
I deleted the cache, rebuilt the navigation.
The result is the same as before.

I'm open for any suggestion ;-)


You may blame the J!Tracker Application for transmitting this comment.

@Sepppl
Copy link

Sepppl commented Apr 20, 2014

@dougransom
please can you set a "JoomlaCode Tracker Item".
I don't know what it means, I guess your request gets done faster. (And mine too ;-) )


You may blame the J!Tracker Application for transmitting this comment.

@Bakual
Copy link
Contributor

Bakual commented Apr 21, 2014

Can you send me an email to bakual@bakual.ch? I can't reproduce this and would like to figure out where the problem is.

@Bakual
Copy link
Contributor

Bakual commented Apr 28, 2014

After investigating we found it's indeed not a bug and working as intended.
The class active is used when the menu item or its child is currently selected, thus the whole tree to the item gets this class.
The class current is the one which is applied to the currently active menu item.

If that doesn't behave like expected, then it's likely a menu module which isn't set up correctly.
Closing as it is not a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants