Forum

Thread tagged as: Runway, Events

Collections inside Events

Trying to get collections (list of venues) to work inside of Events, when I output my page I get the following for the "venue" ID:

Array
(
    [0] => 2
)

Which as Robert Ketter pointed out is "Outside of content your just getting the content of the reference table, basically skip-template in this instance..." Which makes sense to me but being inside of events and not having a slug to match up to the collection puzzles me.

I'm not sure how to retrieve the HTML back from the collection based on what is in the array.

Any help would be appreciated.

Seth Girardin

Seth Girardin 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

I don't understand - where are you getting that?

Here is the related code I have in my events.php(via a template). The array above was what appears in the showall for the ID of "venue".

I have tried adding "scope-parent" equals true, false and removing it all together. Same effect. Also, It's displaying the proper location in the admin.

<perch:related id="venue" collection="Locations" label="Venue" scope-parent="true">
    <perch:content id="venue_name" type="text" />
    <perch:content id="venue_address" type="text" />
    <perch:content id="venue_url" type="text" />
</perch:related>

Showall Capture

Debug Message
SELECT DISTINCT e.* FROM perch2_events e WHERE eventSlug='2016-02-24-gncc-senior-mixed-curling-championship'
SELECT c.* FROM perch2_events_categories c, perch2_events_to_categories e2c WHERE c.categoryID=e2c.categoryID AND e2c.eventID='12'
SELECT * FROM perch2_pages WHERE pagePath='/events/event.php' LIMIT 1
SELECT DISTINCT e.* FROM perch2_events e WHERE eventSlug='2016-02-24-gncc-senior-mixed-curling-championship'
SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
Using template: /templates/events/listing/event-detail.html
SELECT c.* FROM perch2_events_categories c, perch2_events_to_categories e2c WHERE c.categoryID=e2c.categoryID AND e2c.eventID='12'
SELECT * FROM perch2_collections WHERE collectionKey='Locations' LIMIT 1
SELECT * FROM perch2_collection_items ci, perch2_collection_revisions r WHERE r.itemID=ci.itemID AND ci.collectionID=1 AND ci.itemRev=r.itemRev AND ci.itemID=2
Drew McLellan

Drew McLellan 2638 points
Perch Support

Relationships are primarily between Collections, but then I'm not sure why it shouldn't work with other types of content. I'll take a look into it and see what I can find out, but it may be one for a future update.

Thanks, that would be great.

If not, then to get the same functionality now, would I have to use a shared region and a data select?

Would that work inside of Events app?

Drew McLellan

Drew McLellan 2638 points
Perch Support

You shouldn't use a shared region for anything but the smallest chunks of content. A data select might do the job.