Styling for parent link in vertical menu

More
11 years 9 months ago - 11 years 9 months ago #25106 by pegasus
[Not happy that I have to compose this message all over again after it was deleted by your forum's update last night...]

I have a sidebar menu on some pages of the site I'm working on. The top link is the parent page of a section and the other links in the sidebar are children or grandchildren of that parent page. This is a separate menu from the top Main Menu, although it has links to many of the same pages. The sidebar will sometimes contain sub-pages (grandchildren of the top page in that section). The sidebar uses alias links and the base item is set to the Current page.

I want to style it so that all links (including the Parent/top link) show as grey when inactive, light blue on hover and dark blue when active (when that page is being viewed).

The problem is that the top link is always "active" and shows as dark blue. Even when one of its children is active, the top parent always shows as active, presumably because in order to get to the child the path has to go through the parent, thus making its status active.

What I want is for the parent to show as active only when you're viewing that page, but not when you're just viewing one of its children. Instead, I want to show the parent link in a different/specific font-weight (800), so that it will always be distinguished, whether it is active or not.

I'm using MaxiMenuCK with Params. I'm unable to achieve this styling behaviour using Params. I've got the top link specially styled in the menu item for normal, hover and active states. When I first added the normal styling, the top/parent was grey when inactive (correct), but after I added the hover and active styling it went back to being constantly dark blue (showing as active when it should show as normal). (attaching a screenshot of this [parentactive])

Also, the hover colouring seems to only cover the < a > link area, not the < li > area. (attaching two screenshots of this showing the top link hovered incorrectly [parenthovered] and a child link hovered correctly [childhover])

So far I've been unable to grab the parent link to override the CSS from my stylesheet too, because Params puts in-line styling in the elements which automatically overrides my override (even when I use !important).

It seems to me I should be able to do this using Params, since it started to do it but then flipped back again, but somehow it's not working. How can I achieve this kind of styling, either using Params or stylesheet CSS?

Thanks for the help. (and keeping a backup of the message this time)

Edited: I should also mention that the sidebar menu also is showing at a higher z-index level than the main menu, so that the dropdown sub-menu links in the top navigation menu (also MaximenuCK) unfolds behind the sidemenu. Attaching a screenshot of this too [blockingmainmenu].

Wendy






Last edit: 11 years 9 months ago by pegasus.

Please Log in or Create an account to join the conversation.

More
11 years 9 months ago #25108 by ced1870
Hi

[Not happy that I have to compose this message all over again after it was deleted by your forum's update last night...]

I understand, I had some problems with the migration. I shall have closed the forum during this period :)

And do you think about me, that I have to read you many many lines of text ? ... :(

please next time be more concise ;)

What I want is for the parent to show as active only when you're viewing that page, but not when you're just viewing one of its children. Instead, I want to show the parent link in a different/specific font-weight (800), so that it will always be distinguished, whether it is active or not.

you can't do that using maximenu params then because it uses the "active" class that is applied to the entire path until the current item

If you want to do that, you must use your own css and only the class "current", and not "active". The current class is only applied to 1 item and not to the parents

CEd

Joomlack Webmaster and Developer

Please Log in or Create an account to join the conversation.

More
11 years 9 months ago - 11 years 9 months ago #25109 by pegasus

And do you think about me, that I have to read you many many lines of text ? ... :(

Sorry, I was trying to be clear and avoid you having to ask more questions.

If you want to do that, you must use your own css and only the class "current", and not "active". The current class is only applied to 1 item and not to the parents

Thanks, I'll try that.


What about the problem of the top menu dropping down behind the side menu? How can I fix that?

Thanks,
Wendy
Last edit: 11 years 9 months ago by pegasus.

Please Log in or Create an account to join the conversation.

More
11 years 9 months ago #25110 by ced1870

Joomlack Webmaster and Developer

Please Log in or Create an account to join the conversation.

More
11 years 9 months ago #25111 by pegasus
Thanks. It's still not working though. I set the sidemenu to 9 and even set the top menu to 20, but the main menu still unfolds behind the sidebar menu.

Please Log in or Create an account to join the conversation.

More
11 years 9 months ago #25112 by ced1870
have you added the position relative like described ?

Joomlack Webmaster and Developer

Please Log in or Create an account to join the conversation.

Time to create page: 0.218 seconds

Fast and powerful creation, customizable and responsive.

Read More

We have 920 guests and one member online