[Pmwiki-users] WikiTrail modified
Patrick R. Michaud
pmichaud
Tue Sep 7 07:40:45 CDT 2004
On Tue, Sep 07, 2004 at 03:04:09PM +0200, Eike Decker wrote:
> Hi
> I needed a different format for the wikitrails, so I've replaced a few lines in
> the trails.php to accept a $WikiTrailFmt that describes how the trail should be
> formated (I used css to change the appearing of the links with hoveringarrows
> and other stuff like that and therefore I needed to extend this a little bit).
>
> I would be nice if this idea would be part of future releases.
The traditional way to adapt wikitrails has been to create a custom trailstop
function, as in:
include_once('scripts/trails.php');
function CustomTrailStop($link) {
global $pagename;
$t = ReadTrail($link);
// ... rest of code copied from MakeTrailStop here, with modifications
return "whatever you want the trailstop to output";
}
$DoubleBrackets["/<<\\|($TrailLinkPattern)\\|>>/e"] =
'CustomTrailStop("$1")';
> What I've changed in trails.php:
> ...
> SDV($WikiTrailFmt,
> "<span class='wikitrail'><< \$prev | \$link | \$next >></span>");
Calling this variable $WikiTrailFmt is misleading, since it doesn't
get processed by FmtPageName and other $-variables aren't substituted.
We could name it something else (or I suppose we could make it into
a standard FmtPageName-processed string). Still, I think I prefer
to just have customizations done as custom functions for now...
Pm
More information about the pmwiki-users
mailing list