Jump to content

Recommended Posts

Posted

Hi. Sorry if this has been covered someplace. I've got a Conventions site with Events pages. Among other things, each Event has a bunch of Topics and each Topic can have one or more Speakers. The same Speakers crop up again and again, so I've set up a page field for them. I'd like to display all the Speakers involved in the Event (basically, 'crawl' all the Topics and retrieve the Speakers, deal with duplicates and display them). And, the Topics are 'grandchildren' of the Events page (since I have other items on the Events page and want to keep things tidy?).

Speakers
-- Jane Doe
-- John Smith
-- Bob Jones

Events
-- Event One (Event Speakers: Jane Doe, Bob Jones, John Smith)
---- Topics
------- Topic 1 (Speakers: Jane Doe, Bob Jones) (assigned with a Multiple Page field from Speakers)
------- Topic 2	(Speakers: Bob Jones, John Smith)
-- Event Two
...

Once I found out how to access data on a grandchild page, I did used this selector: $speakers = $page->find('template=topic-page')->event_speakers(); 

That returned an array which when looped gave me this:

1840|1843
1843|1841

So, that's the IDs of the 3 speaker pages, with one duplicate, but I don't know what to do with this! Any ideas folks? Or is there another way that I'm missing? Thanks!

Posted

Thanks @Zeka! I didn’t know about ‘owner’. That sounds awesome. I’ve clocked off for the day (with a large Negroni) but look forward to trying this first thing in the morning. Reading that post was enlightening.

  • Like 1

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
  • Recently Browsing   0 members

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