Configuring links: How to change the default wiki link format settingsThe 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>" .
"</tbook:visual>";
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:
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 |