Recent Changes · Search:

Support the Project



edit SideBar


Configuring links: How to change the default wiki link format settings

The format of links to a wiki page is preset. What control do I have over how wiki links are printed?

Bookcase in the library at Hereford Cathedral

All wiki links are configured through format variables, which an administrator can change site-wide, per group or per page. When typesetting the pages in a trail, an administrator can also control whether to treat headings as links or plain text.

There are 3 format variables to control printed wiki links to pages outside the published collection. An administrator can change these in local/config.php before loading the wikipublisher extensions:

  $WPLinkPageExistsFmt = "\$LinkText<tbook:visual markup='sup'>" .
      " (<tbook:url name='\$LinkUrl'>w</tbook:url>)</tbook:visual>";

  $WPLinkPageExistsAnchorFmt = 
      str_replace('>w<', '>w#$LinkAnchor<', $WPLinkPageExistsFmt);

  $WPLinkPageCreateFmt = 
      "\$LinkText<tbook:visual markup='sup'> " .
      "<tbook:url name='\$PageUrl?action=edit'>?</tbook:url>" .

There are also 2 wiki link formats used when printing links to wiki pages within the published collection. An administrator can change these in local/config.php after loading the wikipublisher extensions:

if ( $format=='pdf' ) {
    $LinkPageSelfFmt =
         "<tbook:visual markup='sc'>\$LinkText</tbook:visual>";
    $AnchorLinkFmt =
        "<tbook:visual markup='sl'>\$LinkText</tbook:visual>" .
        " (<tbook:pageref refid='\$LinkName'>p</tbook:pageref>)";

The anchor link format variable causes the typesetting engine to insert a page number reference to the page. It automatically detects whether the referenced page is part of the collection.

As of Wikipublisher library version 2.2.2, the boolean variable $WPLinkPageName controls display of links in headings generated from pages in a wiki trail. By default, when typesetting a book, Wikipublisher uses the text of the link as the heading text. Otherwise it uses the full wiki page reference, and the link is formatted as a “w” (page exists) or “?” (page does not exist) link. An administrator can set $WPLinkPageName in local/config.php before or after loading the wikipublisher extensions:

  • true treats wiki page names as links
  • false formats page links as '$LinkText'

One way to visualise this is by thinking about the table of contents entries derived from the trail. If $WPLinkPageName is true, toc entries will include a “w” or “?”.

Category: navigation aid

« 00026 · Edit Form · 00028 »

Creative Commons License
Edit · History · Print · Recent Changes · Search · Links
Page last modified on 21 November 2016 at 03:08 PM