[pmwiki-users] Easy way to add to wikitext?

Patrick R. Michaud pmichaud at pobox.com
Mon Feb 19 16:25:21 CST 2007


On Mon, Feb 19, 2007 at 04:25:10PM -0500, Ryan R. Varick wrote:
> I designed two paragraphs that are absolutely essential to the layout
> INSIDE of wikitext; a header and footer, more or less.  It looks
> something like this:
> 
> <!--PageText-->
> <div id="wikitext">
> <p id="necessaryTagFromTemplate1>...</p>
> 
> ...PageText output goes here...
> 
> <p id="necessaryTagFromTempate2>...</p>
> </div>
> 
> Shortsighted, I know.  But at this point, it would take extensive work
> and non-structural markup to fix.  I'm always amazed by the
> customizations that are possible with PmWiki, so I hope there is a way
> to sandwich a bit of pre-formatted HTML into PageText -- between the
> opening DIV tag and the actual wiki text, and again between the wiki
> text and the closing DIV tag.

If it doesn't have to be pre-formatted HTML, then you could
just use the Site.SiteHeader approach described at
http://www.pmwiki.org/wiki/PmWiki/GroupHeaders .  It lets you
have wiki markup automatically added to the beginning of 
the text of each page.  (There's an analogous setup for 
adding text to the bottom as a footer.)

If the content you need to add can't be done with wikimarkup,
you should be able to add it using the $GroupHeaderFmt and
$GroupFooterFmt variables.  For example:

    $GroupHeaderFmt = 
      Keep("<p id='necessaryTagFromTemplate1'>...</p>\n") . $GroupHeaderFmt;

    $GroupFooterFmt = 
      $GroupFooterFmt . Keep("<p id='necessaryTagFromTemplate2'>...</p>\n");
     
The Keep() calls prevent PmWiki from treating the contents as markup
(i.e., they're treated as things to be directly output.

Let me know if either of these approaches work for you.

Pm 



More information about the pmwiki-users mailing list