[pmwiki-users] replacing spaces with plusses

Jon Haupt jhaupt at gmail.com
Thu Mar 8 09:34:12 CST 2007


On 2/4/07, Jon Haupt <jhaupt at gmail.com> wrote:
> I'm trying to create custom page variables that show the wiki title
> and the page title with plusses instead of spaces.  In other words,
> instead of {$Titlespaced}, I want {$Titleplussed}, with the result
> showing PmWiki/DocumentationIndex as Documentation+Index.
>
> The wiki title part I found to be pretty easy, and I accomplished it
> with this code:
>
> # PlusIt converts all spaces in a string into plusses.
> function PlusIt($text) {
>  $text = preg_replace('/\s+/', '+', $text);
>  return $text;
>  }
> # page variable
> $FmtPV['$WikiTitlePlussed'] = 'PlusIt($GLOBALS["WikiTitle"])';
>
> However, {$TitlePlussed} is more difficult, or at least I haven't been
> able to figure it out.  Can I do something similar in order to put the
> contents of {$Titlespaced} through my PlusIt function?  Also, could I
> have accomplished the above in an easier way?
>
> Thanks,
>
> Jon
>
I never received a response to this message, so I thought I'd resend
it.  I still haven't been able to figure out why it's harder to do
$TitlePlussed than $WikiTitlePlussed.  If I can get this solved, I can
release a useful social bookmarking links recipe.  Thanks,

Jon Haupt



More information about the pmwiki-users mailing list