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

Patrick R. Michaud pmichaud at pobox.com
Wed Nov 9 14:17:17 CST 2005


On Wed, Nov 09, 2005 at 02:29:31PM -0500, Waylan Limberg wrote:
> On 11/9/05, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> > 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.

Hmm, well, I'm expecting some form of TitledLinks to be incorporated
into 2.1, so maybe I can solve your issue at the same time in the
distribution and be done with it.

I'm thinking the following:

 1. Allow the $LinkPageExistsFmt variable to be able to use a
    page's title as the title= attribute (with the option of always
    loading the title from the page).
 2. Allow PageName"link title" to explicitly set the title= attribute
    (overriding the page's title from #1 if present).
 3. Provide a [[PageName|+]] markup that creates a link to a page
    and uses the page's title as the link text.  It will also use
    the title= attribute from #1/#2 above if those options are set.

So, all that remains is figuring out how to do per-action based
titles.  Of course, with the above you'd be able to do

    [[PageName?action=edit("Edit: PageName's title")]]

and explicitly set the title= attribute.  Getting it to automatically
grab the title into the quotes isn't so straightforward, maybe
we'd want to designate the '+' in this case to also be replaced
with the target's title:

    [[PageName?action=edit("Edit: +")]]

I'll have to think about this last one, but numbers 1 through
3 above ought to be doable.

Pm




More information about the pmwiki-users mailing list