authors (basic)
A key feature of wiki-based systems is the ease of creating hyperlinks (or short links) in the text of a document. PmWiki provides multiple mechanisms for creating such links.
To create an internal link to another page, simply enclose the name of the page inside double square brackets, as in [[wiki sandbox]]
or [[installation]]
. This results in links to wiki sandbox and installation, respectively.
PmWiki creates a link by using the text inside the double brackets. It does this by removing spaces between the words, and automatically capitalizing the first letter of each word following spaces or other punctuation (like ~). Thus [[Wiki Sandbox]]
, [[wiki sandbox]]
, and [[WikiSandbox]]
all display differently but create the same link to the page titled WikiSandbox
.
Or in other words, PmWiki will automatically create the "link path name" using the page name in CamelCase, but the "link text" will display in the format you have entered it.
Some PmWiki sites (default not) will recognize words written in CamelCase, called a WikiWord, automatically as a link to a page of the same name.
There are three ways to get a different link text:
[[(wiki) sandbox]]
links to WikiSandbox but displays as sandbox. For addresses actually containing parentheses, use %28 and %29 https://www.example.com/linkwith%28parenthese%29.
[[WikiSandbox | a play area]]
, or you can use an arrow (->
) to reverse the order of the link text and the target, as in [[a play area -> WikiSandbox]]
. Both links displays as a play area.
(:title PageTitle:)
directive within the page. The page title can be shown instead of the page name with the [[PageName|+]]
link markup, e.g. page BasicEditing
contains the directive (:title Basic PmWiki editing rules:) with the result that a link written as [[BasicEditing|+]]
will display as Basic PmWiki editing rules. See also $EnableLinkPlusTitlespaced
.On top of above ways, a suffix can be added to the end of a link, which becomes part of the link text but not of the target page name.
Note: This feature works with the [[PageName|+]]
markup only since Version 2.2.90.
What to type |
What it looks like |
* [[(wiki) sandbox]] * [[(wiki) sandbox]]es * [[WikiSandbox | wiki sandbox]], * [[WikiSandbox | wiki sandbox]]es * [[BasicEditing | +]] |
From version 2.2.14 PmWiki can show tooltip titles with the following format:
[[https://pmwiki.org"external tool tip title" | external link ]]
, eg external link or https://pmwiki.org
[[Links"internal tool tip title" | internal link ]]
, eg internal link or Links
[[#name"anchor tool tip title"|anchor link text]]
(since Version 2.2.48), eg anchor link text or #name
[[Wikipedia:Wiki"tool tip title"| InterMap link ]]
, eg InterMap link or Wikipedia:Wiki
Links to nonexistent pages? are displayed specially, to invite others to create the page. See Creating new pages to learn more.
Links as written above are links between pages of the same group. To create a link to a page in another group, add the name of that other group together with a dot or slash as prefix to the page name. For example, links to Main/WikiSandbox
could be written as:
What to type |
What it looks like |
* [[Main.WikiSandbox]] * [[Main/WikiSandbox]] * [[(Main.Wiki)Sandbox]] * [[Main.WikiSandbox | link text]] * [[Main.WikiSandbox | +]] |
To link to the "default home page" of a group, the name of the page can be omitted:
* [[Main.]] * [[Main/]] |
See Wiki Group to learn more about PmWiki groups.
Categories are a way to organize and find related pages. The idea is that every page that falls into a particular subject area should have a link to a shared page containing links to other pages on that subject. These shared pages are created in the special group Category
, and thus these subject areas are called "categories".
Adding a page to the category Subject
is simple by adding the [[!Subject]]
markup somewhere on that page. This will create a link to the page Category.Subject
. So [[!Subject]]
is a kind of link shortcut to the page Category.Subject
. See Categories to learn more.
Similar is [[~Author]]
a link shortcut to the page Author
in the special group Profiles
. PmWiki automatically creates this type of link for the current author, when it encounters three tilde characters (~
) in a row (~~~
) in the page text. The current author is the name found in the "Author" field, when you create or modify a page. The current date and time is appended when four tilde characters in a row are encountered (~~~~
).
So, when the Author field contains "Author":~~~
markup will be replaced by: Author?~~~~
markup will be replaced by: Author? October 10, 2010, at 04:50 PM
Time format can be modified in local configuration with $CurrentTime
.
[[PageName|#]]
creates a reference link as shown below[1].
To define a location, or bookmark, within a page to which you may jump directly, use the markup [[#name]]
. This creates an "anchor" that uniquely identifies that location in the page. Then to have a link jump directly to that anchor, use one of
[[#name|link text]]
within the same page, or
[[PageName#name]]
or [[PageName#name|link text]]
for a location on another page
[[PageName(#name)]]
may be useful for hiding the anchor text in a link.
For example, here's a link to the Intermaps section, below.
Notes:
[[#my anchor]]
" won't work, "[[#myanchor]]
" will.
While in HTML the purpose of anchors is mostly for jumping to a position in the text, in PmWiki they serve an internal purpose, too: Each anchor also creates a section, because sections are defined as the part of the page between their start anchor and the next anchor. For more details, see Page Sections.
To link to a specific action for the current page use [[{$FullName}?action=actionname|link text]]
.
Examples:
[[{$FullName}?action=edit|Edit]]
for editing
[[{$FullName}?action=diff|History]]
for history.
Links to external sites simply begin with a prefix such as 'https:', 'ftp:', etc. Thus https://google.com/
and [[https://google.com/]]
both link to Google. As with the above, an author can specify the link text by using the vertical brace or arrow syntax, as in [[https://google.com/ | Google]]
and [[Google -> https://google.com]]
.
If the external link includes (parentheses), escape these using %28 for "(" and %29 for ")" :
[[https://en.wikipedia.org/wiki/Wiki_%28disambiguation%29 | link to "Wiki (disambiguation)" ]] |
The recipe Cookbook:FixURL makes it easy to encode parentheses and other special characters in link addresses.
To have any special characters, including quotes, spaces, parentheses and pipes in link addresses escape them using [=link address=]
.
You can use the Path:
prefix to add links outside of the wiki but on the same website.
Use Path:/path/to/resource
with a leading slash for links relative to the website document root as in www.example.com/path/to/resource
.
You can also define a custom InterMap prefix to a specific path on your website and use it as a shortcut, for example:
Pictures: /assets/pictures/$1
Then in a wiki page, use Pictures:photo.jpg
instead of Path:/assets/pictures/photo.jpg
or https://www.example.com/assets/pictures/photo.jpg
See InterMap for more information.
Not all browsers will follow such links (some Internet Explorer versions reportedly follow them). You can link to a file system by including the prefix 'file:///'
. So file:///S:\ProjPlan.mpp
and [[Shared S drive->file:///S:\]]
are both valid links. On a Windows file system you may want to use network locations (eg file:///\\server1\rootdirectory\subdirectory
) rather than drive letters which may not be consistent across all users. Not all browsers will follow such links, Internet Explorer does allow them.
See also Cookbook:DirList.
Links may also be specified as References, so the target appears as an anonymous numeric reference rather than a textual reference. The following markup is provided to produce sequential reference numbering within a PmWiki page:
Formatting the link as: [[https://google.com |#]]
produces: [2] as the link.
Subsequent occurrence of the reference link format on the same page will be incremented automatically as per the following example: Entering [[https://pmwiki.com |#]]
produces [3], [[#intermaps |#]]
produces [4], and so on for further reference links.
But, it should be noticed that the feature is deliberately kept simple and doesn't work as bibliographic references: this supplemental link [[https://pmwiki.com |#]]
would produces [5] and not reuse the first link definition.
Inter Map links are also supported (see Inter Map). In particular, the Path:
InterMap entry can be used to create links using relative or absolute paths on the current site (e.g., Path:../../somedir/foo.html
or Path:/dir/something.gif
).
To have a link open in another window, use %newwin%...%%
:
%newwin% https://pmichaud.com %%
produces https://pmichaud.com
%newwin% [[https://google.com/ | Google]] %%
produces Google
%newwin% [[Main.WikiSandbox]] %%
produces Main.WikiSandbox
You can also specify that links should open in a new window via the %target=_blank%...%%
attribute:
The following link %target=_blank% https://pmichaud.com %% will open in a new window. | The following link https://pmichaud.com will open in a new window. |
Prefix a link with %rel=nofollow% to advise robots and link checkers not to follow it.
PmWiki automatically gives classes to several types of links. Among other things, this enables you to format each type differently.
Note: This may be an incomplete list.
Note: The default behavior of "+" above can be overridden to display the spaced title, rather than simply the title by adding the following to config.php:
$EnableLinkPlusTitlespaced
= 1;
How do I create a link that will open as a new window?
Use the %newwin%
wikistyle, as in:
%newwin% https://example.com/ %% |
How do I create a link that will open a new window, and configure that new window?
This requires javascript. See Cookbook:PopupWindow.
How do I place a mailing address in a page?
Use the mailto:
markup, as in one of the following:
* mailto:myaddress@example.com * [[mailto:myaddress@example.com]] * [[mailto:myaddress@example.com | email me]] * [[mailto:myaddress@example.com?subject=Some subject | email me]] |
The markup [[mailto:me@example.com?cc=someoneelse@example.com&bcc=else@example.com&subject=Pre-set Subject&body=Pre-set body | display text]]
lets you specify more parameters like the message body and more recipients (may not work in all browsers and e-mail clients).
See also Cookbook:DeObMail for information on protecting email addresses from spammers.
How can I enable links to other protocols, such as nntp:, ssh:, xmpp:, etc?
How do I make a WikiWord link to an external page instead of a WikiPage?
Use link markup. There are two formats:
[[https://example.com/ | WikiWord]] [[WikiWord -> https://example.com/]]
How do I find all of the pages that link to another page (i.e., backlinks)?
In the wiki search form, use link=Group.Page
to find all pages linking to Group.Page.
Use the link=
option of the (:pagelist:)
directive, as in
(:pagelist link=SomePage list=all:) -- show all links to SomePage (:pagelist link={$FullName} list=all:) -- show all links to the current page
Note that (with a few exceptions) includes, conditionals, pagelists, searchresults, wikitrails, and redirects are not evaluated for Wikilinks, and so any links they put on the page will not be found as backlinks. All other directives and markup, for example links brought to the page by (:pmform:), will be found.
What link schemes does PmWiki support?
How do I open external links in a new window or mark them with an icon?
How can I use an image as a link?
Use [[Page| Attach:image.jpg ]] or [[ https://site | https://site/image.jpg ]] See Images#links
Why my browser does not follow local file:// links?
For security reasons, most browsers will only enable file:// links if the page containing the link is itself on the local drive. In other words, most browsers do not allow links to file:// from pages that were fetched using https:// such as in a PmWiki site. See also Cookbook:DirList for a workaround.
How links to the first existed page ? for example [[Group1.Page Group2.Page|Page]]
(:if exists Group1.Page:) [[Group1.Page|Page]] (:elseif exists Group2.Page:) [[Group2.Page|Page]] (:ifend:)
How do I make Reference links also show up on the bottom of the page like Wikipedia? Or, how do I list all links on a page?
See Cookbook:Footnotes.
This page may have a more recent version on pmwiki.org: PmWiki:Links, and a talk page: PmWiki:Links-Talk.
October 25, 2022, at 11:40 PM