New: Learn Statamic on Laracasts!

We've retired the forum in favor of GitHub Discussions.

New conversations can be started on GitHub. Existing conversations will remain for a while longer.

Head over to GitHub →

Check if mounted like is_parent

Jacob Danell April 24, 2021 by Jacob Danell

On my website I have two pages. One project page and one blog page. I then have two collections, projects and blog-posts, that are mounted to the respective pages. I now wish for my navigate menu to have my projects button highlighter when ever I'm inside a project and the blog button when I'm inside a blog-post.

is_current works as intended but is_parent doesn't work, as the pages isn't really a parent, they are just mounted.

So my question is, is there some way to check if the url is a mount-parent of the current page?

>>>>>>> Unanswered <<<<<<<
4 Replies
2 Followers