Jump to content

Page and Page referenced


SadlyMistaken
 Share

Recommended Posts

I am sorry, I am playing with PW only for 6 days, and maybe it is a always repeated question here.. And i am sorry for my bad english too.

I was looking for this in the forum but maybe i use the wrong words..

Please, imagine You have 2 templates: student_template and subject_template

You are going to include a group of PAGE field into student_template... to select what subjects this student is studying..

How can I list in the subject_template the students which have these subjects choosed?

Do i need to include another PAGE field and choose the students, or is there some kind of field or module which do this automaticly?

Thanks a lot.

Hugs from Spain. :D

Link to comment
Share on other sites

I assume you have page field called "subjects" on your student template.

Then the selector would be this:

$studentsStudyingThisSubject = $pages->find("template=student, subjects=$page");

Above code works if you have that code in your subject_template. Then the $page object will have the subject you are looking for.

Hope this helps.

  • 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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...