[pmwiki-users] toggle.php and HTMLFooterFmt question
crisses at kinhost.org
Thu Jul 3 14:55:07 CDT 2014
On Jul 1, 2014, at 12:18 PM, michael paulukonis <xraysmalevich at gmail.com> wrote:
> re: http://pmwiki.org/wiki/Cookbook/Toggle
> In the toggle.php recipe of 2014-02-21, we see the following:
> This should create a simple string that is places into the HTMLFooterFmt hash with the index of "toggle."
> How on earth is toggle supposed to function if there is more than one toggle present on the page?
If you have more than one toggle, make sure they all have a different id. :)
I've used this recipe several times, and I love it. It works very well. When I used it with (:panelist:) for quizzes, I made sure to use a variable from the page (say $Name) as the index.
> Am I missing something in PHP/PmWiki that would allow this to work?
> We don't see anything like this behavior in the older version from 2009-07-23
> Perhaps not coincidentally, I have multiple toggles working with the version from 2009-07-23, but not with 2013-02-21
> Unless I make the following change:
Try the same line in the toggle.php I got from the cookbook (years ago):
The moment that you name it ['toggle'] it will only make one entry in $HTMLFooterFmt. with the  it will just append them all to the array with numbered indexes.
If you want them indexed "toggle" then yes they need unique $id appended to 'toggle" so each index is unique... which is exactly what you said worked.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the pmwiki-users