ACF - Looper

Hi,

I am trying to achieve something I thought it would be easy. But it´s not.
I already saw all the videos about ACF and Loopers, and it wasn’t helpful for this particular case.

I create a field in ACF to apply to Portfolio items. That field is set up as checkbox, to allow the selection of more than one “tag/choice”.
I am using a Looper provider (row) and the Looper consumer to fetch all (tag/choice) of that specific field.
As a normal Looper, I thought I could edit the first one, and all the other would follow a long.
But the problem is that the looper is fetching all “tags/choices” as one, instead of fetching just one choice.

See ACF set up:

To my particular example, I selected 3 of those items for Style (on the portfolio item page) and this is what it looks like when fetching. Above the Style area, im doing the same with portfolio categories and it works fine.

I would like to know how can i fetch one, and repeat with the others?

Thank you

Hello @PanInternational,

Thanks for writing in! A checkbox field is a singular field. You do not need to have a looper to display the value of the checkbox field.

Best Regards.

Hi @ruenel,

Ok. So, how do I make it as singular (ACF) so it can be displayed like categories or tags?

Thank you

Hello @PanInternational

As my colleague @ruenel said, it is already a singular field. To show the singular ACF field, please go through the article: https://theme.co/docs/acf-pro-and-loopers#singular-fields. You can call the data by using the dynamic content code. Example code :
{{dc:acf:post_field field="fieldname"}}

Please change the field name as per your field name.

Hope it helps
Thanks

Hi @prakash_s

Thank you for your reply. I understood Ruenel that the checkbox on ACF acts like a singular field, even though we are able to select more then 1 item. The doc you sent don´t seem to cover my specific issue.

My question is, what field should I use on ACF that allows me to have more then 1 item selected, and fetch them not as singular. Same way categories or tags work, it fetches each individually.

Is it clear?

Cheers

Hello @PanInternational,

The multidimensional fields would the Relational field types.

You may use Taxonomy then:

Hope this helps.

Hi @ruenel,

Thank you for clarifying the way ACF works. It makes a bit more sense now.
Unfortunately, I still didn´t manage to fetch the items from that new Taxonomy field I created.
I´m about to give up (spent hours), I have tried all the combinations possible but it still not working. :frowning:

One last opportunity (see image):

  1. ACF setup as Taxonomy to fetch the Portfolio tags.
  2. On the portfolio item, selected the tags I wanted from the this new ACF field.
  3. Layout Builder Single (portfolio): Set up a DIV as a Provider with Dynamic content Type and for Input {{dc:acf:post_field field=“MY_SELECTED_NAME”}}
  4. Text element inside the DIV as a Consumer (all) and with the text of {{dc:acf:post_field field=“MY_SELECTED_NAME”}}

Hope you can help

Hey @PanInternational,

The WP credentials you previously provided don’t work anymore. Please give us the correct details.

I wonder if you have gone through the nesting repeaters tutorial in our Youtube Channel. That will give you an idea how to output ACF complex data. Please check the links below.

Thanks.

Hi @christian

Sorry. Correct credential on secure note.
Yes, I saw all the videos already, but I am probably missing something.

Hope you can help

Hi @PanInternational,

It has been found that you have used the Thumbnail style as a input to the Looper Provider, which is having the multiple data. But while you are showing the output you used the Thumbnail Age Group which is a Text value i.e. Kinder to 12 and showing the same value for each looper item. I went ahead and changed it to {{dc:looper:item}}, which start showing the Term ID set as a return value at the field defination in ACF.

I would suggest you go through the following article which will help you to show the ACF multi-dimensional field values using the looper.

Hope it helps.
Thanks

Hi @tristup

Thank you for this.
I was asking to fetch the content inside the ACF field (checkbox terms), but what I got now is numbers (term ID) which are not useful. After 5 days and several answers, I will have to assume it´s not possible to achieve what I want. :frowning: Which should be very basic.

I have read that article more then once, and I still don´t see how it´s useful for this case scenario. It is useful for user images only.

It is quite normal to have several tags for a product/blog post, and having only a few important tags displayed, on a page. The inability to do so it´s a big flaw with the amazing Looper element. ´
I think its VERY important to allow the user to choose from an array of tags (or categories) which ones can be fetched.

Hi @PanInternational,

My colleague’s previous responses are all correct, we just need a few adjustments to fetch all the data in the checkbox terms. Please follow all the steps below for future references.

1.) I change the return type of the ACF checkbox field from Term ID to Term Object, this will allow us to access the WP Object of the checkbox.

2.) Then in one of your portfolio items, an example Spirit of Italia, I select items on the checkbox.

3.) In your single portfolio single layout page, I went to your text element and add this dynamic content to display the data: {{dc:term:name}}

4.) As you can see on the front-end, it is now showing the correct checkbox items.

Hope that helps.

Thank you.

Hi @marc_a

Legend. Thank you so much for this. I was getting nuts. :slight_smile:
I don´t doubt that your colleagues were right, but I just wanted what you did and i was not understanding how.
Done.

Thank you!

Hi @PanInternational,

You’re welcome and it’s our pleasure to help you! If you have any other concerns or clarifications regarding our theme features, feel free to open up a new thread.

Thank you.

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