[Pmwiki-users] ugly .tmpl include code

J. Meijer commentgg
Mon Jun 14 17:39:17 CDT 2004


You might have expected

   <!--wiki:Group.Page#anchor-->

to work in your .tmpl, but it doesn't, yet (0.6.21).

In anticipation of this working you may add this code in your config.php:

# enable <!--function:WikiInclude group.page#anchor--> in .tmpl
function WikiInclude($pagename,$includepage) {
  $includepage=trim($includepage);
  PrintText($includepage,
    ProcessIncludes($includepage,"[[include:$includepage]]"));
}

and this in your .tmpl:

  <!--function:WikiInclude Group.Page#anchor-->

Unfortunately this code is pretty useless because the selective include
apparently doesn't function correctly (0.6.21).
[[include:Group.Page#anchor]] should include all text after #anchor up to
the next anchor (or alternatively until the end of text, with
[[include:Group.Page#anchor#]] doing the include up to the next anchor).
Instead it includes only the first line after the anchor.

Maybe everything works in PmWiki 2.. 

-jm







More information about the pmwiki-users mailing list