Tagged: x
-
AuthorPosts
-
March 30, 2016 at 9:38 am #858816
kreativloft3ParticipantHi,
I want to see all menu items of the current level from the current parent, but not from the other parents, nor ancestors.
I have tried to find another topic discribing the same problem and have found this one:https://community.theme.co/forums/topic/keep-sub-menu-open-when-active/
with following conclusion:
ul.x-nav .current-menu-ancestor .sub-menu {
display: block !important;
}But unfortunately this doesn’t work for me, since the default view displays the entire navigation just like a sitemap. (see attachment)
I have tried this, which works for a navigation with only 2 levels:
.sub-menu {
display:none;
}
.current-menu-item .sub-menu, .current-menu-parent .sub-menu, .current-menu-ancestor .sub-menu {
display: block !important;
}
But unfortunately it doesn’t work for menus with 3 levels…
It should look like the second attachment.
Can you help me?
Thank you very much for your help!
Best regards,
OlivierMarch 30, 2016 at 1:22 pm #859185
RupokMemberHi Olivier,
Thanks for writing in! Kindly provide your URL and summarize what you actually want to achieve. Your post is a bit confusing for lot of codes. Kindly clarify the point.
Cheers!
March 31, 2016 at 1:48 am #860254
kreativloft3ParticipantHi,
URL: http://www.imhotec.ch/
Summary: I want to see all menu items of the current level from the current parent, but not from the other parents, nor ancestors.
Desired look: see attachement.March 31, 2016 at 3:11 am #860402
Paul RModeratorHi Olivier,
I can’t seem to find the menu that you referring to in your site.
Can you provide us the exact url of the page where we can see this menu.
Thanks
March 31, 2016 at 4:13 am #860488
kreativloft3ParticipantSorry for that, here it is: http://www.imhotec.ch/produktkategorie/tresor/moebeltresor/serie-eco/
March 31, 2016 at 5:06 am #860542
kreativloft3Participantlet me explain it in different words:
How it is now:non-current-ancestor-menu-item 1
non-current-parent-menu-item 1.1
non-current-menu-item 1.1.1
non-current-menu-item 1.1.2
non-current-menu-item 1.1.3
non-current-parent-menu-item 1.2
non-current-menu-item 1.2.1
non-current-menu-item 1.2.2
non-current-menu-item 1.2.3
non-current-parent-menu-item 1.3
non-current-menu-item 1.3.1
non-current-menu-item 1.3.2
non-current-menu-item 1.3.3
current-ancestor-menu-item 2
non-current-parent-menu-item 2.1
non-current-menu-item 2.1.1
non-current-menu-item 2.1.2
non-current-menu-item 2.1.3
current-parent-menu-item 2.2
non-current-menu-item 2.2.1
current-menu-item 2.2.2 <—————–current-menu-item
non-current-menu-item 2.2.3
non-current-parent-menu-item 2.3
non-current-menu-item 2.3.1
non-current-menu-item 2.3.2
non-current-menu-item 2.3.3
non-current-ancestor-menu-item 3
non-current-parent-menu-item 3.1
non-current-menu-item 3.1.1
non-current-menu-item 3.1.2
non-current-menu-item 3.1.3
non-current-parent-menu-item 3.2
non-current-menu-item 3.2.1
non-current-menu-item 3.2.2
non-current-menu-item 3.2.3
non-current-parent-menu-item 3.3
non-current-menu-item 3.3.1
non-current-menu-item 3.3.2
non-current-menu-item 3.3.3as you see, all sub-menus from the non-current menu-items are visible, whereas I only want to see the current-menu-item sub-menu. Just like this:
non-current-ancestor-menu-item 1
current-ancestor-menu-item 2
non-current-parent-menu-item 2.1
current-parent-menu-item 2.2
non-current-menu-item 2.2.1
current-menu-item 2.2.2 <—————–current-menu-item
non-current-menu-item 2.2.3
non-current-parent-menu-item 2.3
non-current-ancestor-menu-item 3March 31, 2016 at 6:23 am #860639
ZeshanMemberHi there,
To achieve that, please replace following CSS code from your child theme’s style.css file:
.current-menu-item .sub-menu, .current-menu-parent .sub-menu, .current-menu-ancestor .sub-menu { display: block !important; }with this:
.current-menu-item > .sub-menu, .current-menu-parent > .sub-menu, .current-menu-ancestor > .sub-menu { display: block !important; }Hope this helps. 🙂
Thank you!
March 31, 2016 at 6:42 am #860671
kreativloft3ParticipantThis helped! 😀
Thank you very much!!!March 31, 2016 at 11:18 am #861039
RupokMemberYou are welcome!
Glad that it helped. Feel free to let us know if you face any other issue. We’ll be happy to assist you.
Thanks for using X.
Cheers!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-858816 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
