Like this, right?
Oh yes, I got that, sorry.
I was asking if there’s a more succint alternative than nesting the clone group inside another group.
From what I understand there’s none, besides using prefixes, with all the disadvantages you already mentioned.
The best and most flexible way would be to use Flexible content (which is the way I usually go, but in this project I can’t)
Nevertheless, I prefer to get the values as an array using get_field on the outer group, without resorting to nested cycles.
So your suggestion is not cloning the whole group in #2, but the single fields contained in the “source” group?
This could be a problem if the source group has many fields or if I need to add a field to the source group.
In that case I should add the new field in every place I cloned the other fields, and this is something I would avoid.
What I’m tryng to do is something similar to the flexible content field (which I can’t use for a number of reasons).
I would like to have a Field Group where I create several “modules”, where each one is a group containing some fields.
Then in other Field Groups pertaining to pages or posts or whatever, I clone the specific modules I need for that page (the whole group, not the single fields contained in it).
Also, I could need multiple instances of the same module, which is the topic of this thread.
What is the best strategy to do this?
Thank you.
Yes, as I wrote in #2
I tried to follow the suggestion posted by John in https://support.advancedcustomfields.com/forums/topic/many-of-the-same-clone-in-another-set-of-fields/#post-129384 so:
if (have_rows('testimonials')) {
while (have_rows('testimonials')) {
the_row();
echo get_sub_field('title');
}
}
However if I use this code
$testimonials = get_field( 'testimonials' );
all values are inside $testimonials[‘testimonials’]
Clearly I’m missing something…any clues?
Same here…any suggestion?
* Issues with repeater fields – when I add the fields inside the repeater, they are picking up a field_id of “acfcloneindex” and then not display correctly on the front end.
I have the same problem when adding a new field inside a group, in a option page.
I don’t have ACF Extended installed.
When I add a new field ONLY using the top button, the field is generated with a key = acfcloneindex and it doesn’t open the field automatically.
When I save the fields, the field is saved outside the group.
If I use the bottom button everything works correctly.
See:
https://freeimage.host/i/bsDhVs
Hi, any clues?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.