00050: UrlLinkFmt is hard-coded in the LinkIMap function

Summary: UrlLinkFmt is hard-coded in the LinkIMap function
Created: 2004-09-19 16:13
Status: Closed - fixed for 2.0.devel6
Category: Feature
From: jr
Assigned:
Priority: 5
Version: 2.0dev4
OS:

Description: It is no longer possible to override the default formatting of url links.

This is causing a problem in converting the publish script to pmwiki 2:

  • it can't redefine the link layout
  • it can't collect all link references and list them at the end of the generated page -- it's non-trivial to intercept calls from MakeLink to LinkImap to build a list of references and then display them with a suitable format at the end

PmWiki should at least have a UrlLinkFmt variable.


Agreed -- When writing the function I just hard-coded the text in place with the intent of replacing it with a variable after I knew better how all of the link functions fit together and what the variable should be called. It will reappear in an upcoming development version soon. --Pm


Done. PmWiki 2 now has the $UrlLinkFmt variable which provides the default text for any url-link. In addition, I've added $IMapLinkFmt, which allows custom text to be defined for any InterMap type or URL scheme. For example, one can change the rendering of ftp-links via:

    $IMapLinkFmt['ftp:'] = "<a class='ftplink'
         href='\$LinkUrl'>\$LinkText</a> (ftp)";

or one could change Cookbook-links via:

    $IMapLinkFmt['Cookbook:'] = "<a class='cookbooklink' href='\$LinkUrl'>\$LinkText
        <img src='cookbook.gif' /></a>";

Should be released in 2.0.devel6.

--Pm