[pmwiki-users] Multiple CategoryGroups: 404 header
Patrick R. Michaud
pmichaud at pobox.com
Tue Sep 26 12:39:50 CDT 2006
On Tue, Sep 26, 2006 at 07:25:20PM +0200, Petko Yotov wrote:
> > FWIW, using separate punctuation characters for each extra
> > category *could* lead to some problems down the road, especially
> > since some of them (such as '?') already have another meaning in
> > certain contexts.
>
> It *is* special, because if there is no such category, the link renders as a
> normal link. The tip from Martin Fick (thanks Martin!) to patch pmwiki.php
> will probably do the job for the price of some inconviniences on upgrades.
> But when I copy the code for the !Category it works, because ot the 'L'
> variable in:
>
> Markup('[[!','<[[','/\\[\\[!(.*?)\\]\\]/e',
> "Keep(MakeLink(\$pagename,PSS('$CategoryGroup/$1'),NULL,'',
> \$GLOBALS['LinkTagFmt']),'L')
>
> I believe this 'L' causes the pmwiki.php function LinkPage to skip the
> PageExists check for the target page.
The 'L' just indicates that this is a link. It's the
$GLOBALS['LinkTagFmt'] that "bypasses" the PageExists, by
specifying the exact format that should be used for displaying
the link (as opposed to letting the LinkPage function decide).
> But from your suggestion about future problems and for the sake
> of simplicity, I am considering adding markups, containing the
> group names:
> <snip>
This will probably work. But I'm pretty sure we'll soon
be adding some form of "automatically create targets" capability,
in which case you'll be able to specify something like:
$AutoCreateTargetPatterns[] =
'/^(Tag|ProjectCategory|ContactCategory)\\./';
This will automatically create the target category pages
as soon as someone saves a page containing a target link
in one of these groups. In other words, if someone writes
a page containing
[[ProjectCategory/XYZ]]
then upon saving the page PmWiki will automatically create
"ProjectCategory.XYZ" if it doesn't already exist.
Pm
More information about the pmwiki-users
mailing list