Defining Active Menu Trail Using Menu Position
This section will be explaining how to apply the active menu trail using the Menu Position module which is already installed and configured within Varbase.
Let us visit the Blogs landing page section on the site, you will notice the "Blogs" on the main menu is active but once you visit one of the Blog posts, you will notice the "Blogs" is no longer active.
![](https://docs.varbase.vardot.com/~gitbook/image?url=https%3A%2F%2F1551857219-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-legacy-files%2Fo%2Fassets%252F-LMp_PWjEdZQrVE520s3%252F-MLZiP1uEK6TQiisy_A5%252F-MLZnPv9Rd9OU8QxpjB6%252Fimage.png%3Falt%3Dmedia%26token%3D49af6c37-93cf-449e-896e-92dc71a84eef&width=768&dpr=4&quality=100&sign=919e6a90&sv=1)
This is a problem for the users because they will get lost and get confused if they are still in the blogs section or they were in another section of the site.
To solve this issue, we can simply by adding a position rule to the Blog post content type. Navigate to: Administration \ Structure \ Menu Position Configuration
As you have noticed there are no rules yet, please follow the instruction on how to add a Menu Position Rule:
Click the "Add Menu Position Rule" button
Add a label "Blog posts"
Make sure the checkbox is Enabled
Select "Main Navigation" from the "Parent menu item" drop-down field
Make sure the "Blog post" is checked from the "Content type" under "Conditions"
Click the "Save" button
You can add rules to Content type, Language, Pages, and Roles.
Now if you go back to the blog post content, you will notice the "Blogs" menu item is active.
Last updated