msavard Posted September 21, 2018 Share Posted September 21, 2018 I have a bunch of FAQ pages that each have a page reference field on them. When I go to a page on the site I would like to pull back a list of all the FAQs that include the current page in it's page reference field. Is that possible? matt Link to comment Share on other sites More sharing options...
kongondo Posted September 21, 2018 Share Posted September 21, 2018 $faqs = $pages->find("template=template-of-faq-pages, page_ref_field_of_faqs=$page, limit=10"); we are limiting to 10 hits in this example. 1 Link to comment Share on other sites More sharing options...
msavard Posted September 21, 2018 Author Share Posted September 21, 2018 Wow, that works great, thank you! I didn't realize I could just check for the reference field=current page. That does make it really easy though. Link to comment Share on other sites More sharing options...
adrian Posted September 21, 2018 Share Posted September 21, 2018 Maybe also of interest: https://processwire.com/blog/posts/processwire-3.0.107-core-updates/#what-pages-point-to-this-one 1 Link to comment Share on other sites More sharing options...
kongondo Posted September 21, 2018 Share Posted September 21, 2018 (edited) Thanks @adrian. I was looking for that one but couldn't find it. I had a feeling I'd read about it somewhere. How would it work in this case, just throw in the page ref field in the selector part? Edited September 21, 2018 by kongondo 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