[pmwiki-users] toggle.php and HTMLFooterFmt question

Hans Bracker design at softflow.co.uk
Thu Jul 3 20:12:54 CDT 2014

Hello Michael,

Tuesday, July 1, 2014, 5:18:10 PM, you wrote:

> In the toggle.php recipe of 2014-02-21, we see the following:

> $HTMLFooterFmt['toggle'] = "<script type=\"text/javascript\">document.getElementById(\"{$id}\").style.display = '{$style}';</script>";

> 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?

sorry, but toggle.php version 2014-02-21 as on pmwiki.org does not contain the code line you quoted!
Instead it contains the line (as did previous versions):

   $HTMLFooterFmt[] = "<script type=\"text/javascript\">document.getElementById(\"{$id}\").style.display = '{$style}';</script>";

So  it  is working just fine, because multiple instances each with the
correct id of each toggle object are created in the HTML footer (exactly what Chrisses
mentioned).  The main java script is injected into the HTML foter just
once, which is also fine.

So  I  do  not  understand why you have an issue with toggle.php. Am I
missing something?

mailto:design at softflow.co.uk

More information about the pmwiki-users mailing list