Jump to content

Is the active Page part of a specific 'Page' reference field?


BenG
 Share

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...