Jump to content

A property for children of Pagetablefields with the page-id of the Pagetablefield


horst
 Share

Recommended Posts

So, when storing those pagetable child pages as native children in the pagetree, we can easily get them selected. But when we need to store them on a different (out of the way) location in the pagetree, this relation is lost. Wouldn't it be nice to have the ability to build a selector like:

$pagetablechildren = $pages->find("parent-pagetablefield={$page->pagetablefield->id}, template=xyz");

Or is this already possible and I simply don't know it?

  • Like 1
Link to comment
Share on other sites

Nice trick!

Yeah my use case was to show last updated images from a specific page mixed with a bunch of other "regular" pages, couldn't seem to get it working. Also there was some pain in merging both arrays (didn't seem compatible), plus sorting with dates on different field names (native created + custom date for some of the content) at the same time.

:)

Link to comment
Share on other sites

The page table pages are referenced in the field.

So how about using this? Unless I'm not getting it what you're after.

$pagetablechildren = $pages->get("template=xyz, pagetablefield=$page")->pagetablefield;
  • Like 2
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...