Jump to content

Best way to use page fields in a selector tag


onjegolders
 Share

Recommended Posts

$biology = $pages->get("/subjects/biology/");

$biology_students = $pages->find("template=student, subject=$biology, sort=title");

It does pretty much the same as your code, but in a more readable way. Also works with multiple pages like this:

$subjects = $pages->find("template=subject, some_selector=value");

$students = $pages->find("template=student, subject=$subjects, sort=title");
Edited by apeisa
removed the unnecessary $this from code examples.
  • Like 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

×
×
  • Create New...