SelfReferences

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


Question

How can I control how a page refers to itself, as in "SelfReferences"?

Answer 1: Disabling self-references entirely

You can prevent a page from creating links to itself by selectively disabling its WikiWord. Simply add the following lines to your local/config.php file:

    $title = FmtPageName('$Title',$pagename);
    $WikiWordCount[$title] = 0;

Answer 2: Changing the text of a self-reference

You can also completely customize the way in which a self-reference will be displayed via the $WikiWordReplaceFmt array. For example, adding

    $title = FmtPageName('$Title',$pagename);
    $WikiWordReplaceFmt[$title] = "<b class='selfref'>$title</b>";

to local/config.php will cause any occurrences of the page's title to be displayed in bold (and not linked).

See also

  • PmWiki.LinkVariables

pmwiki-2.5.9 -- Last modified by {{Pm}}

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

Array
(
    [post_max_size] => 64M
    [$_POST keys] => 
    [$_REQUEST keys] => n
    [$_SERVER] => Array
        (
            [CONTEXT_DOCUMENT_ROOT] => /home/pmwiki/public_html
            [CONTEXT_PREFIX] => 
            [DOCUMENT_ROOT] => /home/pmwiki/public_html
            [GATEWAY_INTERFACE] => CGI/1.1
            [HTTPS] => on
            [HTTP_ACCEPT] => */*
            [HTTP_ACCEPT_ENCODING] => gzip, br, zstd, deflate
            [HTTP_COOKIE] => imstime=1777485368; PHPSESSID=hqkkv66hkbs95p0behb4ugu6j7
            [HTTP_HOST] => www.pmwiki.org
            [HTTP_USER_AGENT] => Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
            [HTTP_X_HTTPS] => 1
            [PATH] => /bin:/usr/bin
            [PHP_INI_SCAN_DIR] => /opt/cpanel/ea-php70/root/etc:/opt/cpanel/ea-php70/root/etc/php.d:.
            [QUERY_STRING] => n=Cookbook%2dV1%2fSelfReferences
            [REDIRECT_HTTPS] => on
            [REDIRECT_QUERY_STRING] => n=Cookbook%2dV1%2fSelfReferences
            [REDIRECT_SCRIPT_URI] => https://www.pmwiki.org/wiki/Cookbook-V1/SelfReferences
            [REDIRECT_SCRIPT_URL] => /wiki/Cookbook-V1/SelfReferences
            [REDIRECT_SSL_TLS_SNI] => www.pmwiki.org
            [REDIRECT_STATUS] => 200
            [REDIRECT_UNIQUE_ID] => afJGdQifw_iiPpr8L2RDowAAAJE
            [REDIRECT_URL] => /wiki/Cookbook-V1/SelfReferences
            [REMOTE_ADDR] => 216.73.216.31
            [REMOTE_PORT] => 61156
            [REQUEST_METHOD] => GET
            [REQUEST_SCHEME] => https
            [REQUEST_URI] => /wiki/Cookbook-V1/SelfReferences
            [SCRIPT_FILENAME] => /home/pmwiki/public_html/index.php
            [SCRIPT_NAME] => /index.php
            [SCRIPT_URI] => https://www.pmwiki.org/wiki/Cookbook-V1/SelfReferences
            [SCRIPT_URL] => /wiki/Cookbook-V1/SelfReferences
            [SERVER_ADDR] => 23.254.203.248
            [SERVER_ADMIN] => webmaster@pmwiki.org
            [SERVER_NAME] => www.pmwiki.org
            [SERVER_PORT] => 443
            [SERVER_PROTOCOL] => HTTP/1.1
            [SERVER_SIGNATURE] => 
            [SERVER_SOFTWARE] => Apache
            [SSL_TLS_SNI] => www.pmwiki.org
            [TZ] => America/Los_Angeles
            [UNIQUE_ID] => afJGdQifw_iiPpr8L2RDowAAAJE
            [PHP_SELF] => /index.php
            [REQUEST_TIME_FLOAT] => 1777485429.9712
            [REQUEST_TIME] => 1777485429
            [argv] => Array
                (
                    [0] => n=Cookbook%2dV1%2fSelfReferences
                )

            [argc] => 1
        )

)