[pmwiki-users] pmwiki-2.1.beta1 released, svn available

Patrick R. Michaud pmichaud at pobox.com
Mon Nov 21 15:14:16 CST 2005

On Mon, Nov 21, 2005 at 06:47:23PM +0100, Roman wrote:
> I think that title should be used only if it is specified. 

Reasonable, however PmWiki's stance is that every page has a title.
If there's no (:title:) markup, then the page's title is its name.

> * [[Group1.HomePage|+]]
> * [[Group2.HomePage|+]]
> * [[Group3.HomePage|+]]
> * [[Group4.HomePage|+]]

Well, first of all I would instead do:

    * [[Group1.Group1|+]]
    * [[Group2.Group2|+]]
    * [[Group3.Group3|+]]

and there's no ambiguity.  But perhaps you have reasons for
needing to use "HomePage" here.  
> * Title of Group 1
> * Group2.HomePage?
> * Group3.HomePage?
> * Group4.HomePage?

This is asking a fair bit of the "[[target|+]]" markup,
because it's saying that we should pretend that the "|+"
isn't really there whenever the page doesn't exist.
But it *is* there, which means the author wanted the
page's title (which typically doesn't include the
group name).

So, I'm going to leave this one as a local customization --
try the following in your config:

    function TitleLink($pagename, $target, $suffix) {
      $tname = MakePageName($pagename, $target);
      $txt = (PageExists($tname))
             ? FmtPageName('$Title', $tname, 1)
             : NULL;
      return MakeLink($pagename, $target, $txt, $suffix);
    Markup('[[|+', '<[[|',
      "Keep(TitleLink(\$pagename, PSS('$1'), '$2'), 'L')");

Demonstrated at http://www.pmwiki.org/wiki/Test/NonExistentTitles .


More information about the pmwiki-users mailing list