<p><br>
On Jul 29, 2012 1:42 AM, "John Rankin" <<a href="mailto:john.rankin@affinity.co.nz">john.rankin@affinity.co.nz</a>> wrote:<br>
><br>
><br>
> > John Rankin <<a href="mailto:john.rankin@affinity.co.nz">john.rankin@affinity.co.nz</a>> wrote:<br>
> >> Try this test: put (:toc-hide:) into one of the pages (ie not in the<br>
> >> GroupHeader) and see if the page toc appears in the side bar.<br>
> ><br>
> > Yes, when I put it directly into a page, then I get the toc in the<br>
> > aside.<br>
> ><br>
> Cool! You also wrote:<br>
><br>
> > In Site.GroupHeader, I have the following:<br>
> ><br>
> > (:description {*$:Summary}:)(:toc-hide:)<br>
><br>
> How do you tell pmwiki to include Site.GroupHeader in<br>
> {$Group}.GroupHeader? The pagetoc code needs a way to detect that the page<br>
> includes a (:toc-hide:) when it is not part of the page's text. In case<br>
> you are wondering, (:toc-hide:) tells the pagetoc code to generate anchors<br>
> for (:toc-page:) links to find.<br>
></p>
<p>I use  a version of Cookbook:AllGroupHeader in local/config.php.</p>
<p>> If all else fails, we can do this:<br>
><br>
> function RemoteTableOfContents($pagename,$ref,$self=0) {<br>
>     global $TocHeaderFmt,$RemoteTocFmt;<br>
><br>
>     global $TrustMeIKnowWhatIAmDoingHonest;<br>
>     SDV($TrustMeIKnowWhatIAmDoingHonest, false);<br>
><br>
>     $oTocHeader = $TocHeaderFmt;<br>
>     $TocHeaderFmt = str_replace('$Toc',$ref,$RemoteTocFmt);<br>
>     $tocname = MakePageName($pagename,$ref);<br>
>     if ($tocname==$pagename && $self==0) return '';<br>
>     $tocpage=RetrieveAuthPage($tocname,'read',false);<br>
>     $toctext=@$tocpage['text'];<br>
><br>
>     if ($TrustMeIKnowWhatIAmDoingHonest) $toctext = '(:toc-hide:)'.$toctext;<br>
><br>
>     if<br>
> (preg_match('/\(:([#\*])?toc(?:-(float|hide))?(?:\s+anchors=(v)isible)?(?:\s+(.*?))?(?:\s+(Q))?:\)(.*)$/se',$toctext,$m))<br>
>         $toc = str_replace('[[#',"[[$ref#",<br>
>             TableOfContents($tocname,$m[1],'page','',$m[5],PSS($m[6])));<br>
>     $TocHeaderFmt = $oTocHeader;<br>
>     return $toc;<br>
> }<br>
><br>
> You could then add the following line to local/config.php:<br>
><br>
>     $TrustMeIKnowWhatIAmDoingHonest = true;<br>
><br>
> JR<br>
> --<br>
> John Rankin<br>
></p>
<p>Maybe what I'm after isn't quite clear. For this design, I want a top-level toc to appear in an aside (think sidebar, but nothing else). I want this on every page, but rather than having to include (:toc-hide:) on every page in the wiki, I want to have in one place. I would like it to include all heading displayed, not just those in the page text itself. I may just end up writing my own.</p>