BenG Posted August 15, 2014 Share Posted August 15, 2014 Hi, I'm building a second menu. Therefore I followed Ryans proposal from here: https://processwire.com/talk/topic/726-multiple-menus/#entry6018 I have 2 Page reference fields with PageListSelectMultiple as Inputfields and added both fields to the home template. Everything is working fine so far.But: I want to check if the current (active) page is part of a specific Page field. How can I do that? Page fields: nav_main nav_side Listing all pages from nav_side is simple: foreach($pages->get("/")->nav_side as $item) { echo "<li><a href='{$item->url}'>{$item->title}</a></li>"; } But how can I do something like that: if (isset($page->nav_side)) { ... } Thank you! Ben Link to comment Share on other sites More sharing options...
marcus Posted August 15, 2014 Share Posted August 15, 2014 I think this will work $nav_sides = $pages->get('/')->nav_side; if ($nav_sides->has($page)) { //... } 4 Link to comment Share on other sites More sharing options...
BenG Posted August 15, 2014 Author Share Posted August 15, 2014 Ah! Thank you. That does the trick! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now