Can't figure out how toDisplay Relationship data on Single Layout Page

Hello,

First time user. I have an ACF called Artists…and one called Exhibitions…the Artist ACF has a field called Exhibitions which is a Relationship to the Exhibitions one. Then, I have a Single Layout Page with all the Artist details…I have a Row/Column/Text where I would like to display all the Exhibitions that Artist has exhibited. I added a Looper Provider to the Column with Dynamic Content set to exhibitions – {{dc:acf:post_field field=“exhibitions”}} – and then a Looper Consumer to the Text box…but I don’t get any results…

Any ideas? Thanks in advance

A little more on this…it looks like I’m almost there because the looper provider seems to provide some data…for example, this Artist has 4 exhibitions associated…and it looks like there are now 4 text blocks one for each Exhibit…but the data is empty,

Hello @fernbergergallery,

Thanks for writing to us.

To help you with your concerns we need to check your setting, I would request please share the admin login details meanwhile I would suggest you troubleshoot a few of the common issues before we investigate your settings. Please share your details in a secure note. Please provide the following details

  • WordPress Login URL
  • Admin-level username and password
  • Exact page URL and layout URL

You can find the Secure Note button at the bottom of your posts

Thanks

Thanks, @prakash_s

I was able to figure out the original issue which was that I didn’t have the Looper provider associated with a div but instead to a text field…however, I have the next issue I can’t solve on our Exhibitions page …where I can display the Exhibitions metavalues EXCEPT for a relationship data (in this case, the name of the Artist)

Hey @fernbergergallery,

You will have to nest another Looper Provider to display the Relationship field. Kindly check out this video first:

Hope this helps.

thanks, @ruenel but that’s how I have it set up (based on first video; i don’t think i need a repeater since my fields aren’t repeaters but Relationship instead). One looper provider which is the Exhibition and nested inside a Looper Provider for the Artist (relationship field). The first video kind of does the same with the User field nested inside the Classes field but I can’t get it to work. My nested looper doesn’t display any data from the Artist relationship fields…i can’t figure out why…

Hey @fernbergergallery,

You already have the correct Looper setup. Just make sure to use the Preview options.

Cheers.

Hi, @ruenel

Sorry for the confusion but that’s the wrong page…Yes, i have it working when it’s a Single Post Layout like the Artist page you show…however, i need help with doing this on a regular page…see the one called “All Exhibitions” please…I can’t get the relationship working on that one (and i did pretty much what I did on the Artist Layout page)

thanks, Raza

Hey Raza,

You will have a Looper to display all exhibitions first and then nest another looper to display the Artists in each Exhibition item.

You can check out this demo structure shown above.

Thanks.

That’s the way I think I have it configured. There are three Columns with each with a Provider which is a query string to the Exhibitions ACF based on the date to give me either the current, upcoming or past Exhibitions…then within each, i have a looper to give the details of each exhibit. I can get the name of each Exhibition as well as start and end dates…These fields are NOT relationships just text or dates…To get the Artist, I’ve tried having a looper associated with a nested div but i get all artists not just the one that is set for an individual exhibition…and i don’t know how to get the specific one that was selected for that individual (there is only one artist per exhibition).

I guess i need to have a meta_query where i compare the array to the artist somehow…just not sure how to do that

Hello Raza,

Your Looper structure should be like this:

Section 
   Row
      Column 1 - Looper Provider Query String (to display Exhibit items with particular dates)
         DIV - Looper Consumer 
            Text
            Text
               Row - Looper Provider Dynamic Content ({{dc:acf:post_field field="artist_exhibiting"}})
                  Column - Looper Consumer
                     Text
                     Text

You may check out the demo I have created in the secure note below.

Cheers.

Awesome…that’s what i wanted…thanks for the help…i still have to analyze exactly what you did though!

regards, Raza

You are most welcome, Raza.

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