horst Posted May 22, 2015 Share Posted May 22, 2015 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? 1 Link to comment Share on other sites More sharing options...
LostKobrakai Posted May 22, 2015 Share Posted May 22, 2015 This is already on the Wishlist, but named a little different. https://processwire.com/talk/topic/9730-get-pages-used-by-a-pagefield/ 2 Link to comment Share on other sites More sharing options...
Pierre-Luc Posted May 25, 2015 Share Posted May 25, 2015 This, and hopefully pageimage at the same time. Got bit a little last week. Link to comment Share on other sites More sharing options...
Macrura Posted May 26, 2015 Share Posted May 26, 2015 @Pierre-Luc, $pageimage->page will get you the page; not sure if this is a subfield though for use in selectors; 1 Link to comment Share on other sites More sharing options...
Pierre-Luc Posted May 26, 2015 Share Posted May 26, 2015 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 More sharing options...
LostKobrakai Posted May 26, 2015 Share Posted May 26, 2015 PageArray's are not compatible to PageFiles, but you should be able to import both in a single basic WireArray. Link to comment Share on other sites More sharing options...
Soma Posted May 26, 2015 Share Posted May 26, 2015 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; 2 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