[pmwiki-users] Link Formats and the title attribute.

Waylan Limberg waylan at gmail.com
Wed Nov 9 13:29:31 CST 2005


On 11/9/05, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> On Wed, Nov 09, 2005 at 01:54:48PM -0500, Waylan Limberg wrote:
> > > See http://www.pmwiki.org/wiki/Test/LinkTitles for
> > > a demonstration.
> > >
> > Excellent! However, without it working for page links, it is of little
> > use to me. And as far as that goes, the title of the page seems more
> > practical. Why should I type the title in each time I link to the page
> > when I have a page title anyway. (I'm using my EditTitle recipe which
> > requires every page to have a title)
>
> Oh.  Why not use or modify the Cookbook.TitledLinks recipe
> to do what you want?

I did take a quick look at the code, but I don't remember what it was
like. I think I had a little difficulty following exactly what it was
doing, so I asked first. If you have any comments on that code, it may
be helpful.
>
> > Although, I have noticed that the title does not come through on all
> > links only some (the others get the page name), and I can't seem to
> > identify any consistent pattern to narrow down the cause. For an
> > example see this page: http://warrenforestcourt.org/Rules/Rules.
>
> Well, determining a page's title requires reading the page file,
> and reading the page file every time there's a link to the page
> can become a somewhat expensive proposition on some sites---especially
> if they aren't making a whole lot of use of titles (as many of us
> are not).
>
> Whenever PmWiki reads a page it caches certain attributes such
> as the title and permissions so it won't have to re-read that
> information later, and when asked to display a $Title for a page
> it uses the (:title:) if it's cached it already and the page name
> if it hasn't.
>
> I can probably provide an option to get LinkPage to always
> read and cache the target's page information, at some
> cost in performance.  Then $Title would always work for
> page links.  Or, if you want $Title to work everywhere
> regardless of where it might happen to be used, I can give
> you a customization that will do that (and it could potentially
> be very expensive for page rendering).
>
Hmm, not sure which way would be better. Although i understand the
apparent inconsistency now. Perhaps the best would be to cache all
page titles, where the cache would only be updated on a page save, or
something like that. Of course, that would be one more file PmWiki
would have to request and one very long array to read into memory and
iterate through for each link - especially on a big site. Maybe a
separate cache file for each group. but then cross group links could
create even more overhead. Yeah, this could get ugly. I think for now
I'll just deal with things the way they are. Thanks for the input.


--
----
Waylan Limberg
waylan at gmail.com




More information about the pmwiki-users mailing list