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 = ??????
    elseif( get_row_layout() == 'download' ): 
        key_id = ??????
        $file = get_sub_field('file');

    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