submenu — mark first level as active
-
yes! this makes total sense, i will work on it today i think
-
-
hello
so while i was checking i noticed that this seems to already work as you expected.
can you post your website url so i can check why it might not work for you?
customize -> menu style -> active menu point
this style will be applied automatically to the first level menupoint whenever you're on a page of its submenu. for me that works
-
-
-
can you send your website address, /wp-admin/ username and password and a link to this topic to info@laytheme.com?
-
-
so by looking at your website, it seems that you dont use submenus.
solution 1:
you have a menupoint "projekte".
this is a page.if it was a category page in "wp-admin" -> "projects" -> "categories"
create a category called "projekte" or rename the default category to "projekte"
now make sure to assign this category to all existing projects.now in "wp-admin" -> "projects" -> "categories", click on the category "projekte"
in here, you will have a gridder. put your thumbnailgrid here or whatever you want.now in "appearance" -> "menus", in your menu use the newly created category page instead of a normal page
now whenever you're in a project that uses this category, that menupoint will be active.
alternative solution 2:
<script> window.laytheme.on('newpageshown', function(e){ if(jQuery('body').hasClass('type-project')) { jQuery('.menu-item-18').addClass('current-menu-item'); } }); </script>your menu item that is the projects menu item has a html class of "menu-item-18". I found this out by using the chrome inspector. Every browser has an html inspector tool.
We can add the class "current-menu-item" to it, whenever we're on a project type page. This is what the script does.
Enter this css in "lay options" -> "custom css & html" -> "custom head content"
With solution 1 its easier to get it right if for example you have multiple types of project categories and multiple menu items that should stay activated when you're in a project with one of these categories.
-
Thanks so far, but this would not be a solution for the whole page, I think?! Maybe I still missed to become clear enough:
The active "top-Menu" should be should also hav the active status, when the sub-site is active, on all sub-pages on the site, such as on e.g. "büro". They are all listed as "sub-sites" in the admin-area.
Meaning when I open the page "team" — which is a subset to "Büro" — the according top-menu-item "büro" should be set as "active, in this case 50% grey.
Can you have a look, thanks. -
<script> window.laytheme.on('newpageshown', function(e){ if(jQuery('body').hasClass('type-project')) { jQuery('.menu-item-18').addClass('current-menu-item'); } else if(jQuery('body').hasClass('type-lay_news')){ jQuery('.menu-item-15').addClass('current-menu-item'); } if(window.location.href.indexOf('/buero/') !== -1){ jQuery('.menu-item-17').addClass('current-menu-item'); } }); </script>i inserted this script to your page this should work for now
you're right, for subpages i should make it work by default
im writing it down -
but basically its about menupoints getting the active state when we are on a subpage and the menupoint is the menupoint of a parent page.
there is no submenu here like this one: https://laytheme.com/documentation/menus.html#submenus
thats why i didnt understand the issue at first
-
but for the case "projekte" menupoint you could still use my solution 1:
http://laythemeforum.com/topic/10772/submenu-mark-first-level-as-active/11however, then the permalink would be /category/projekte
not sure if u want that
-
A arminunruh referenced this topic on
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login