Browser: Chrome 110 OS: macOS URL: Local Site Video: Jam
Created an ACF group called “hero_section” and inside this group is a repeater called “cta_cards”. One of the fields in cta_cards is a simple radio select field called “card_options” to allow customizing the style of the card. However, noticed that ACF repeater values aren’t rendering for customer attributes on the front-end.
Unfortunately, I cannot reproduce the issue (independent of the return type of the radio fields).
Would you be so kind as to send temporary login credentials and a link to this thread to help@bricksbuilder.io using the email address you used during the purchase?
Yes, I noticed that too, haha (it was really late last night when I was recording), but we tried every possible dynamic data combination (correctly too ).
{acf_cta_cards_card_style}
{acf_cta_cards_card_style:value}
{acf_cta_cards_card_style:array_value}
{acf_cta_cards_card_style:array_value|value}
{acf_cta_cards_card_style:array_value|value}
{acf_cta_cards_card_style:numeric}
{acf_hero_section_cta_cards_card_style} - even tried to insert the parent ACF group name thinking this was needed
{acf_hero_section_cta_cards_card_style:array_value|value}
Still not working. Query Monitor is reporting “Not Doing It Right” with parent theme, so unsure if our ACF Group > Group > Repeater is the issue for choice fields or if the way array data inside groups and repeaters gets rendered. See attached. Even tested duplicating the field and still same issue.
Sent details to support so we’ll see what the main issue is…
However, I think there may be some confusion and questions to better understand how Bricks and ACF repeaters work.
For instance, if we have the following scenario with ACF…
ACF fg = “Core Pages” (post type = pages)
GROUP - hero_section
** TEXT - hero_h1 {acf_hero_section_hero_h1}
** REPEATER - cta_cards “Bricks: Query Loop for same page/post’s repeater”
*** TEXT - card_text {acf_cta_cards_card_text}
*** LINK - card_link {acf_cta_cards_card_link}
*** RADIO - card_options {acf_cta_cards_card_options:array_value|value}
Then we duplicate that original ACF field group (Core Pages) for post types “services”, along with all the same groups, fields, repeater…
New duplicate ACF fg = “Services” (post type = services)
GROUP - hero_section
** TEXT - hero_h1 {acf_hero_section_hero_h1}
** REPEATER - cta_cards “Bricks: Query Loop for same page/post’s repeater”
*** TEXT - card_text {acf_cta_cards_card_text}
*** LINK - card_link {acf_cta_cards_card_link}
*** RADIO - card_options {acf_cta_cards_card_options:array_value|value}
We create a section called “Hero Section” for the homepage with all the same uniform dynamic tags. Copy and use this inside a Service post type template. Each and every other ACF field type with the same field name (example: {acf_hero_section_hero_h1} or {acf_hero_section_hero_image} ) works fine, regardless of the post-type that the Brick’s element it is used with.
The idea is we can build a library of interchangeable Brick’s sections/templates with the dynamic data tags pre-set and then use those anywhere else (as long as ACF field names match )
Is there any issue with naming fields the exact same for different ACF post-type fields?
Does Bricks only refer to the current post-type’s meta data / conditionally set post-type?
Should ACF field group’s repeater fields all be named differently for different post-types?
Is there a manual query loop code we can use instead for repeaters that have the same name?
Pardon all the questions here. I will send you coffee, haha.
Just trying to ask any questions that others may experience as we continue to grow the Brick’s ecosystem and move towards interchangeable components
Thanks for all your help and taking a more in-depth look on our dev site!
As per my email reply yesterday.
If you really want to use SAME group name, SAME field name in different field groups, you should be able to get the result correctly as long as the ACF field structure and field settings are exactly same for these 2 different field groups.
Same settings means: (example)
Do not set the link type field in field group A to return value only but link type field in field group B to return array.
Subfields for a repeater in field group A are text, link, and radio. But subfields for a repeater in field group B are text and link only. This causes radio value missing like your staging site.
This is super helpful @itchycode - Makes more sense now. I appreciate your time in further explaining and will move to make these modifications with our fields going forward.