[Pmwiki-users] Free link questions
Patrick R. Michaud
pmichaud at sci.tamucc.edu
Mon Mar 17 20:41:51 CST 2003
> --
> Um, no; I had misunderstood $Tlink. What I need is a reference that is $Title for a WikiWord and {{$Title}} for a free link. In fact I'm now having a hard time understanding what {{$Title_}} does, 'cos it's not a valid free link reference... (I assume it's fine if the space replace character is '').
Sorry, in my previous message I totally misdescribed what $Tlink does
(because I mis-read my own code). I think it in fact does almost what
you want--it's "$Title_" for a WikiWord and "{{$Title_}}" for a non-WikiWord.
Thus a page named "WikiWord" becomes "WikiWord", a page named "Pagename"
becomes "{{Pagename}}".
$Tlink uses $Title_ (and not $Title) because otherwise it doesn't
work properly with $PageNameSpace set to null (the default).
Given the following page names:
page name $Tlink using $Title_ $Tlink using $Title
WikiWord WikiWord # ok WikiWord # ok
Freelink {{Freelink}} # ok {{Freelink}} # ok
Wiki_Word {{Wiki_Word}} # ok {{Wiki Word}} # wrong!
Free_link {{Free_link}} # ok {{Free link}} # wrong!
Note that the last two examples are wrong if $PageNameSpace is null, because
{{Wiki Word}} and {{Free link}} become links to a pages named "WikiWord"
and "FreeLink" (not "Wiki_Word" and "Free_link").
All of which serves to show just how much I hate underscores and how
they mess things up. 1/2 :-) If we didn't have the possibility of
underscores in pagenames, then $Tlink using $Title would work just fine,
and $Title_ wouldn't be needed.
Pm
More information about the pmwiki-users
mailing list