PmWiki /
Linksauthors (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. Links to other pages in the wikiTo create an internal link to another page, simply enclose the name of the page inside double square brackets, as in 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 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. Links with different link textThere are three ways to get a different link text:
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.
Links with tool tipFrom version 2.2.14 PmWiki can show tooltip titles with the following format:
Links to nonexistent pagesLinks to nonexistent pages? are displayed specially, to invite others to create the page. See Creating new pages to learn more. Links to pages in other wiki groupsLinks 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
To link to the "default home page" of a group, the name of the page can be omitted:
See Wiki Group to learn more about PmWiki groups. Category linksCategories 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 Adding a page to the category User page linksSimilar is So, when the Author field contains "Author": Link shortcuts
Links to specific locations within a page -- "anchors"To define a location, or bookmark, within a page to which you may jump directly, use the markup
For example, here's a link to the Intermaps section, below. Notes:
SectionsWhile 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. Links to actionsTo link to a specific action for the current page use Examples:
Links outside the wikiLinks to external sites (URLs)Links to external sites simply begin with a prefix such as 'http:', 'ftp:', etc. Thus If the external link includes (parentheses), escape these using %28 for "(" and %29 for ")" :
The recipe Cookbook:FixURL makes it easy to encode parentheses and other special characters in link addresses. Links to intranet (local) filesNot all browsers will follow such links (some Internet Explorer versions reportedly follow them). You can link to a file system by including the prefix See also Cookbook:DirList. Link characteristicsLinks as ReferencesLinks 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: Subsequent occurrence of the reference link format on the same page will be incremented automatically as per the following example: Entering IntermapsInter Map links are also supported (see Inter Map). In particular, the Links that open a new browser windowTo have a link open in another window, use
You can also specify that links should open in a new window via the
Links that are not followed by robotsPrefix a link with %rel=nofollow% to advise robots and link checkers not to follow it. Links and CSS ClassesPmWiki 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.
NotesNote: 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: ## [[target |+]] title links Markup('[[|+', '<[[|', "/(?>\\[\\[([^|\\]]+))\\|\\s*\\+\\s*]]/e", "Keep(MakeLink(\$pagename, PSS('$1'), PageVar(MakePageName(\$pagename,PSS('$1')), '\$Titlespaced') ),'L')"); How do I create a link that will open as a new window? Use the
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
The markup 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: [[http://example.com/ | WikiWord]] [[WikiWord -> http://example.com/]] How do I find all of the pages that link to another page (i.e., backlinks)? In the wiki search form, use Use the (: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 [[ http://site | http://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 http:// such as in a PmWiki site. See also Cookbook:DirList for a workaround. This page may have a more recent version on pmwiki.org: PmWiki:Links, and a talk page: PmWiki:Links-Talk. |