Jump to content

Using value of editable_pages from PageEditPerUser module in API selector


Tyssen
 Share

Recommended Posts

I want to be able to use the page that a user is assigned to do other things in my templates.

If I do this:

$ap = $user->editable_pages;
echo $ap; 

I get a number output. But if I do this:

$lp = $pages->get($ap);
echo $lp->title;

I get an error:

Unknown Selector operator: '[empty]' -- was your selector value properly escaped?

If I hard code the actual number from echo $ap in the get selector then I get the output I'd expect.

What do I need to do to $ap recognised as a PW page object?

Link to comment
Share on other sites

Maybe your $ap is a pageArray and not a single page? Maybe you test this better with var_dump($ap), as you seems to be in scope of template files, it will out strings / numbers, but it is a pageArray. Check this, or check with echo count($ap); or echo $ap->first(); to see if it is a number or an array.

  • Thanks 1
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...