[pmwiki-users] markup question

Patrick R. Michaud pmichaud at pobox.com
Tue Mar 21 10:53:02 CST 2006

On Tue, Mar 21, 2006 at 04:39:17PM +0000, Hans wrote:
> Tuesday, March 21, 2006, 4:26:02 PM, Patrick wrote:
> > It ought to work.  Can you give more details about the markup
> > being used...?
> It did not work when putting toggle buttons or links into a sidebar
> using showhide.php or togglelink.php.
> then I constructed the following for dummy testing, just checking the
> html source, and it did not work in the same way. it only works when
> on the SideBar page, or when the markup is on the page rather than the
> sidebar (which is the case obviously when on the SideBar page).
> # Dummy test with markup (:sbtest:)
> Markup('sbtest', 'directives',
>   '/\\(:sbtest:\\)/e',
>   "SBTest(\$pagename)");
> function SBTest($pagename) {
>   global $HTMLHeaderFmt, $HTMLStylesFmt;
>   $HTMLHeaderFmt['sbtest'] = "
>   <script type='text/javascript'><!--
>   //dummy 
>   --></script> ";
>   $HTMLStylesFmt['sbtest'] = "
>        #dummy {background:yellow}
>   ";
> };

Ohhh, I see the problem.  The SideBar pages are generated
as part of the templates, as in...


But, guess what -- these directives occur after the header
text has already been output (by the <!--HeaderText--> directive
above).  So, by the time the SideBar page is being output, the
headers are already gone.

This is one of the very annoying things about dynamic page 
generation in HTML -- one has to know the complete contents of
<head> before starting any output.  It would be nice if HTML
had allowed the possibility of multiple <head> and <body>

(Along these lines, it's really annoying that one cannot have
<meta> or <link> elements anywhere but the <head>.)


More information about the pmwiki-users mailing list