Adding a Link to Post's Current Terms Referenced from A Relationship Field

I have Events in The Events Calendar Pro that I’m tagging with course subjects under Events > Tags. The tags are things like Algebra, Data Science, Artificial Intelligence, etc.

I’ve setup an ACF relationship field that will appear on these Event Tags and allow me to associate these tags with a page.


What my client wants us to do is link each of the event’s tags with the curriculum page that is is associated with.

Here is my setup in the Events Single Layout

DIV (Tags) - Looper Provider = Current Post Terms
   DIV (Tag Container) - Looper Consumer = All
      DIV (Pull Relationship Field) - Looper Provider = Dynamic Content = {{ acf.post_field({"field":"associated_curriculum_page"}) }} & Looper Consumer = All
           HEADLINE (Tag) - Permalink = {{ post.permalink }} //This should be the link of the associated curriculum page

Unfortunately, this is not working. I can pull all the current post terms, but I can’t grab the link of the associated curriculum page to link onto the tags’ permalink. Any ideas how I can achieve this?

Hello @OctoCog,

Thank you for the inquiry.

Since you’re using the Current Post Terms provider, you have to retrieve data related to the terms. So instead of using post.permalink, try using term.url.

Let us know the result.

Best regards,
Themeco

@Ismael Thank you for your recommendation. Unfortunately, it did not work. I changed {{ post.permalink }} to {{ term.url }}

Thank you for the update. We may have misunderstood the element outline above and need to inspect the page to properly understand the issue. Please create a test page, then provide the login details in the secure note.

@Ismael I’ve added the secure note with access to the staging site. Feel free to make changes as you see fit.

Thank you for the info. We can’t find the associated_curriculum_page field anywhere. Did you remove it? The Looper Provider > Dynamic Content for this field is also not included in the Event Single Layout. Could you provide a direct link to the field and the template?

@Ismael My apologies. The version of the site I gave you access to didn’t have the associated_curriculum_page. You should see it now on this version.

If you go to Events > Tags and you click on any of the tags you should see the relationship field at the bottom of the tags page. In ACF > FIeld Groups you should be able to find the field under “Event Tags Fields”.

Let me know if you have any other questions.

Hello @OctoCog,

Your element structure is this:

You need to run another looper to access the associated_curriculum_page field. Therefore, the looper structure would somehow be like this:

DIV (Tags) - Looper Provider Current Post Terms
   DIV (Tag item) - Looper Consumer 
      DIV (Associated Pages) - Looper Provider Dynamic Content `{{dc:term:meta key="associated_curriculum_page"}}` & Looper Consumer = All
           HEADLINE Tag Name `{{dc:post:title post="{{dc:looper:item}}"}}` with `{{dc:post:permalink post="{{dc:looper:item}}"}}` as permalink

Kindly let us know how it goes.

@ruenel That works perfectly! Thank you for your help.

Glad to know this has been resolved! Let us know if you have more questions. Have a nice day.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.