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

Roman romat2 at gmail.com
Tue Nov 22 07:27:06 CST 2005


2005/11/21, Patrick R. Michaud <pmichaud at pobox.com>:
> 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.

"Homepage" was just an example of page name that is common for several
groups. In my case I have e.g. Module1/HomePage, Module1/ToDo,
Module1/Commands, Module1/Variables, Module1/Tables etc. But anyway, I
will try to switch from Group1.HomePage to Group1.Group1 convention.

>
> > * 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('[[|+', '<[[|',
>      "/(?>\\[\\[([^|\\]]+))\\|\\s*\\+\\s*]]($SuffixPattern)/e",
>      "Keep(TitleLink(\$pagename, PSS('$1'), '$2'), 'L')");
>
> Demonstrated at http://www.pmwiki.org/wiki/Test/NonExistentTitles .
>
> Pm
>

Excelent. You helped me again to understand things "under the hood". Thanks.

Roman




More information about the pmwiki-users mailing list