Skip to content

Access linked references (that aren't just images) #163

@mwickett

Description

@mwickett

What's the best method to iterate over referenced content objects? This is a single page marketing lander, so it's not a "blogging" use case.

I have a "client testimonial" section (id: clientSection) that has the following:

  • Headline (single item)
  • Body (single item)
  • Reference field (multi-item) that points to a "testimonial" content type that has a couple of text fields and an image reference

I'm doing contentful.clientSection[0].headline and contentful.clientSection[0].body for the first two, and I tried doing:

each testimonial in contentful.clientSection[0].testimonials
        p= testimonial.testimonial
        p= testimonial.attribution

but because the testimonials are references, not directly in the clientSection object, it's not working.

Is there a way to follow reference links?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions