Support

Account

Home Forums Add-ons Flexible Content Field Create a global counter for a layout type Reply To: Create a global counter for a layout type

  • Thanks @elliot. I have done this but there are two things that do not work here.

    • The counter resets every time a new section is created, meaning I get multiple ID’s that are the same, which creates conflicts
    • The ID’s generated are based on the placement in their section meaning there might not be an ID with a value of 1 or 2 if for example an accordion isn’t the 1st/2nd item within the section. The resulting ID’s I get returned are the following:
      id="ac-3"
      id="ac-8"
      id="ac-3"
      id="ac-6"
      id="ac-5"

    The second bullet point isn’t a problem if the second counter in my footer.php file can just get all ID’s (no matter what they are) for the accordion layout type and generate a line of JS to match but I don’t know if this is possible. I only know of the way to do this sort of thing with a counter.