Jump to content
Jonathan Lahijani

How to get a Page field's ID only

Recommended Posts

I have a Page field and in ProcessWire, I can get values from it like this:

$page->my_page_field; // returns the ID
$page->my_page_field->title; // return the title

Given my particular situation, I'm hitting an infinite loop as I documented here a few years ago:
https://github.com/ryancramerdesign/ProcessWire/issues/1962

Is there a way to ONLY get the raw ID of the assigned page without ProcessWire getting all the attributes of that page leading to the loop?

Share this post


Link to post
Share on other sites
On 9/22/2019 at 1:13 AM, Jonathan Lahijani said:

I see that if I enable auto-join for the field, then it circumvents the issue.  So that's one solution.

That sounds like a good solution. Are you not happy with it?

RockFinder2 might be overkill here, but if you have it available it might be an option:

Z5nARIR.png

"owner" is a regular single page field. Or if you need multi-page-values:

rGy5ZeL.png

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...