Is there a way to retain a variable over multiple shortcodes? In this special case I have a Bootstrap 4 gallery shortcode that mainly operates via ID of the surrounding div to make controls (prev/next, select slide) work. I wonder if I can automate creation of a variable that is unique and does not come up again if the shortcode is run for instance multiple times in a list. Right now I am adding an ID parameter for the shortcode and have to care myself to keep them unique.
An idea is to create an ID from the “local” info from the frontmatter - this however would now work with two galleries in one post…