Home Forums Add-ons Flexible Content Field Unique ID, count flexible field? Reply To: Unique ID, count flexible field?

  • Flexible content itself does not contain a unique ID. However, you can easily append one when outputting the flexible content. For example, if outputting your slider wrap it in a container such as:

    <div id="slider-container-<?php echo $counter++; ?>" class="slider-wrapper">
    Container content...

    Define $counter before your loop and set it to 1 or 0.

    If you’re using jQuery you can also set the context for the selector so it does not apply it document-wide: