[Pmwiki-users] Custom links

Patrick R. Michaud pmichaud
Tue May 11 17:17:22 CDT 2004


On Tue, May 11, 2004 at 01:14:12PM -0500, James S. Carlson wrote:
> Hi there,
> 
> My users are posting small summaries in a list on one page, which after a
> bit of text want to be linked to a larger document.  The trick is, I want
> the little "more" link to always be a picture (a little arrow, with the
> word 'more' after it.)  So what I want is something like
> [[more:PageName]]... but I'm not sure of the Right Way to do that.  Do I
> mess with the DoubleBrackets array, or something else...?  The output
> would look something like:
> <a href="[page name formatted appropriately]"><img src="/path/to/image"></a>

$DoubleBrackets['/\\[\\[more:(.*?)\\]\\]/'] =
  '[[$1 http://server/path/to/image]]';

should work.  This converts every link of the form "[[more:PageName]]"
to be "[[PageName http://server/path/to/image]]", where it can then
be processed like any other wiki markup.

Pm



More information about the pmwiki-users mailing list