[pmwiki-users] Show/Hide recipe - encorporated within Headers

huw walters huw.walters at mail.com
Mon Mar 12 13:36:17 CDT 2007


Hi;

I am trying to make it so that the show/hide buttons or toggle links can be encorporated within normal Headers. What I have come up with is the following markup (which more or less works):


Markup('^!!new','directives','/^(!{1,6})\\s?(.*)$/', 
 "/<div>
<h1>$2 [--(:toggle init=hide div='$2' lshow='&#x2193 Show Content &#x2193;' lhide='&#x2191 Hide Content &#x2191;':)--] </h1>
<div id=$2>" );

However there are two problems with it...

1) Although 'init' is set to 'Hide', it shows the content when the page first loads up (although the button does actually read 'Show Content'). On pressing the button, the label changes to 'Hide Content' and on hitting this, the content does indeed hide...  Does anyone know why this happens and what can be done to fix it?

2) When using the Section Edit script, the section edit link for the section below is hidden within the section above it. I know there should be a way to place the link BELOW the header - i.e. on the first line of the section (as described in http://www.pmwiki.org/wiki/Cookbook/SectionEdit). However, I cannot get it to work (at least not using Monobook skin) ... I think that perhaps i do not understand the explanation given on that page.  

If anyone can help me out, it would be really appreciated... as being able to do this would make all the difference to my website.

Thanks;

Huw

=




More information about the pmwiki-users mailing list