Forum
Perch Runway Headless Related
Hi,
Using Runway, I'm trying to get items in a collection, and it returns the items beautifully. I've got a perch:related
section in Perch, but at the moment the JSON returns the ID of the related item, rather than the content of the related item.
How can I return the related items details?
Cheers.
You'd query the related collection using the IDs that you now have.
Could they be returned as part of the same "set", in the same location within the item?
I'm not sure I understand the question.
So, can the related items data, be included within the same area as the related collection currently is (currently appearing as an ID), or would it need to be returned as part of a new set?
My current code:
The most efficient way would be to fetch your content and the related items and join them back together at the front end. That'll save you retrieving each related item each time it's used. You'll just get it back once.
Ah, so you're saying to use separate API calls?
No, I'd add them to the same response as a new set.
Gotcha.
Yeah that makes sense, thanks Drew.