[pmwiki-users] Tags and colon

Carlos A. Bonamigo carlos.ab at gmail.com
Mon Oct 23 14:43:30 CDT 2006


Em Segunda 23 Outubro 2006 11:36, Crisses escreveu:
> 
> On Oct 23, 2006, at 4:20 AM, christian.ridderstrom at gmail.com wrote:
> 
> > On Mon, 23 Oct 2006, Carlos A. Bonamigo wrote:
> >
> >> Why colons can't be used within tags?
> >>
> >> i.e.  = [[!Candy:Bar:Caramel]]
> >>
> >> and then have a category page like:
> >>
> >> Category/Candy:Bar:Caramel
> >
> > With the above you'd like to create a page called
> > 	Category/Candy:Bar:Caramel
> >
> > AFAIK, ':' is not allowed within the name of a page so it won't work.
> 
> : is not allowed by default.
> 
> To allow page names with a colon, a couple things need to be added to  
> PmWiki.  this is being actively used on http://similepedia.com
> 
> 
> Add to the top of config.php:
> 
> 
> // Allow : in pagenames
> $NamePattern = '[[:upper:]\\d][\\w:]*(?:-[\\w:]+)*';
> $PageNameChars = '-:[:alnum:]';
> 
> $QualifyPatterns["/\\{([-:\\w\\x80-\\xfe]*)(\\$:?\\w+\\})/e"] =
>      "'{' . ('$1' ? MakePageName(\$pagename, '$1') : \$pagename) .  
> '$2'";
> 
> // : in page names may interfere with page text variables -- this  
> corrects the problem
>    Markup('{$var}', '>$[phrase]',
>      '/\\{(\\*|!?[-:\\w.\\/\\x80-\\xff]*)(\\$:?\\w+)\\}/e',
>      "htmlspecialchars(PageVar(\$pagename, '$2', '$1'), ENT_NOQUOTES)");
> 
> 
> 
> And now : works!
> 
> Crisses

Thank you,

Carlos




More information about the pmwiki-users mailing list