[pmwiki-users] Default styling of links to non-existent pages

christian.ridderstrom at gmail.com christian.ridderstrom at gmail.com
Fri Jan 27 16:10:21 CST 2006


On Fri, 27 Jan 2006, Patrick R. Michaud wrote:

> On Fri, Jan 27, 2006 at 09:35:15PM +0100, Dominique Faure wrote:
> > 
> > I would love having just a set of ...Fmt variables (more surely an
> > array) to overload in my skins to handle all the cases:
> 
> I think these variables already exist.
> 
> > 1+2: Link to page, present or not,
> 
> 1:  $LinkPageExistsFmt         page is present
> 2:  $LinkPageCreateFmt         page not present
> 
> > 3+4: Link to attachment, present or not,
> 
> 3:  $IMapLinkFmt['Attach:']    attachment is present
> 4:  $LinkUploadCreateFmt       attachment not present
> 
> > 5: Link to external site.
> 
> 5:  $UrlLinkFmt                link to non-page
> 
> > For the last case (5), an other nice feature would be to allow
> > customization per intermap entries. This could help to provide a more
> > visual topic-dedicated  linking system.
> 
> 5+:  $IMapLinkFmt['http:']     http: links
>      $IMapLinkFmt['https:']    https: links
>      $IMapLinkFmt['PmWiki:']   links to PmWiki: InterMap shortcut
>      $IMapLinkFmt['Cookbook:'] links to Cookbook: InterMap shortcut

Would it be possible to replace the format string with a hook if so
desired?  Perhaps I could then use that for my 'uploads:'-links (see my
other rather long post). The hook function that I supply would then check
if the uploaded file exists, and return either a customized format string,
or simply the relevant HTML depending on this condition.

An alternative would be to think of a more general way to determine if the
target exists or not. That might be worthwhile since the existance is in
question for both pages and attachments. Something similar would make
sense both for links to pages in another field as well my 'uploads:'-case.

It would not make sense in general for links that actually do point 
outside the server.

/Christian

-- 
Christian Ridderström, +46-8-768 39 44               http://www.md.kth.se/~chr






More information about the pmwiki-users mailing list