ThisSite

<< | Cookbook-V1 | >>

Note: The recipes here are for PmWiki versions 0.6 and 1.0 only. For PmWiki 2.0 recipes, see Cookbook.


Goal

Provide the keyword "ThisSite:" to link to pages on current site outside the wiki.

Solution

Add the following lines to your local.php

 $SiteUrl = 'http://'.$HTTP_SERVER_VARS['HTTP_HOST'];
 $LinkPatterns[400]["\\bThisSite:($UrlPathPattern)"] = $FmtUrlLink;
 $InterMapUrls['ThisSite'] = $SiteUrl."/wiki/";

It is also possible to change the script URL for links within wiki. This example shows the use on https servers:

 $ScriptUrl = 'https://'.$HTTP_SERVER_VARS['HTTP_HOST'] . $HTTP_SERVER_VARS['SCRIPT_NAME'];

Discussion

Just use "ThisSite:/somepath/somepage.htm" to set local links on any wiki page.

Contributors

Mailinglist User pmwiki-2.3.33 -- Last modified by {{}}?

from IP: 85.171.160.186 ip should be disabled by default for security reasons