Home › Forums › Add-ons › Flexible Content Field › Flexible Content "key" › Reply To: Flexible Content "key"
Hi Elliot, I have all my layouts working fine and use the get_row_layout()
to retrieve the corresponding layout file with no dramas.
What I am after is a unique identifier for each layout module.
For example, if I have two Gallery modules on the same flexible content area, I assume each one has a different ID of some kind so that the images from Gallery A are not mixed with images from Gallery B.
So when looping over the modules, is there an ID associated with each module added in the back end?
something like this….
if( get_row_layout() == 'paragraph' ):
key_id = ??????
the_sub_field('text');
elseif( get_row_layout() == 'download' ):
key_id = ??????
$file = get_sub_field('file');
endif;
Hence, each Paragraph added to the page with have unique KEY for it.
I hope I am making sense and not missing something that is easy 🙂
Thanks, Sam
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.