SOLVED: Link to an anchor id via ACF field

I’m wanting to link an ACF dynamic header to an anchor id on a different page, but can’t figure out if there’s a way.

Usage: A query loop of conference sessions with speakers’ names - {acf_speaker} - which I want to link to the speakers page, but target the individual speaker on that page via an html id anchor id, retrieved via an acf field in the session CPT - {acf_speaker_link}.

Bricks easily allows me to link to the speaker page (internal page link), but I would like to know if there’s a way to target a specific place down the page. Or maybe this is a feature request?

Hope this makes sense!

Hi Mick,

the easiest way is to provide the link already within your {acf_speaker_link}. You can use a field type of URL, set https://your-speaker-page.com# as default value and extend it per session with the speaker ID. Doing so, you can choose dynamic data and your text will link to your speaker page / the anchor on that page.

First, I thought of using external link together with {acf_speaker_link} as anchor ID, but that doesn’t work, because the dynamic data logic assumes that {acf_speaker_link} is a full link as well, so it prefixes it with https…

Best regards,
timmse

ACF Field

Single Post with ACF Field
image

Heading element in query loop

Thanks timmse,

That’s also the conclusion that I came to given the options available. I don’t know why, but I was hoping there might be a facility for appending something to the link. But your suggestion works fine :relaxed:

1 Like