Board Thread:Support Requests - Getting Technical/@comment-366087-20131019142844

Haya Agin…

On the Kim Possible Fanon Wiki, I've modified Template:Spoiler to gen a button "Spoiler" with collapsible text. Spoiler Works fine, see The Supreme One/Every Kim Possible. Entering Spoiler|HiddenText gens the button with text in collapsed state.

Problem is, for more than one Spoiler on the page, the code as is means clicking *one* spoiler-button expands ALL spoilers. I understand why, all have the same id=spoiler. I've tried adding a piped variable to the template and id=spoiler. Which sorta worked. Spoiler|HiddenText|2 allowed each of two buttons to operate independently, although "HiddenText|2" is exactly what printed.

I tried to use an #if to control the 2nd variable (ideally should be the first, with second the content, but one shoe at a time…) while suppressing it printing, but while the buttons were still separate, the content was screwed.

Is there a way to automate incremental ids? Ideally just checking for prior-positioned Template:Spoiler. At the very least variables, preferably Spoiler|tag|HiddenText …where "tag" is either a number or text string.(should tag be empty, then ignored)

Slightly related: I'm presuming there is no way to collapse an entire page…? Looks like too many formatting codes break a div class to use 1 huge one start-to-end  