[pmwiki-users] ptv - showhide interference

Hans design5 at softflow.co.uk
Fri Sep 26 03:35:11 CDT 2008


Friday, September 26, 2008, 8:41:27 AM, kjettil wrote:

> I've noticed an interference between the ShowHide Cookbook script and 
> the PTV commands, when you have PTV definitions, the show PTVs command
> and the ShowHide command on the same page:

> 1 - On the page I define a set of PTVs and make them visible with

> {(allptvs)}

> 2 - On the same page I use the ShowHide to hide or show a photo

> (:showhide div=box1 init=hide lshow='Show picture' lhide='Hide picture':)
 >>>id=box1<<
> Attach:my_photo.jpg|Some text
> Some other text
 >>><<

> 3 - The result is that above the listing of the PTVs' contents you find
> printed

> my_photo.jpg|Some text

> independently of whether the picture is shown or hidden.

> 4 - If I have only text in the box, or if the PTVs are defined on a 
> another page, then it works OK.

> Is there a remedy?

the {(allptvs)} markup expression from the PowerTools recipe will list
all PTVsfrom the current page.
'Attach:my_photo.jpg|Some text' is read as a PTV, i.e. it follows the
Varname:value syntax.
So {(allptvs)} includes it in the listing.
Since no attempt to avoid markup rendering from markup present within
a PTV is made, the image shows.
The ShowHide will hide your image initially, but the markup is still
in the page, and {(allptvs)} picks it up.


  ~Hans




More information about the pmwiki-users mailing list