ACF Relationship Fields

First, thanks for this plugin.

My template looks like:

<Loop acf_relationship=news_person>
    <a href="<Field url />"><Field title /></a>

It is meant to create a list of links to people who are related to a news post via an ACF relationship field.

The result is:

 <a href="https://page-where-code-is-located/<Field url/>">Joe Smith</a>

The docs for Relationship say See Post Loop for available fields. I think URL and Title should both work, but I’m not sure where I’m going wrong.

Cheers, Richard

Maybe the <> in the template tag in the HTML markup have to be escaped?
But i’m not sure how to proceed, maybe by doubling them:

<a href="<<Field url />>">

1 Like

Thanks @avanti,

I just found Tag in attribute in the docs says to replace < with { So this works:

<Loop acf_relationship=news_person>
  <a href="{Field url}"><Field title /></a>

I would mark this post as solved, but I don’t think that option has been turned for this instance of Discourse


Oh, that was it, nice find!
I was testing and couldn’t get to something, thanks for sharing. :wink:

it works better indeed: