Recent Changes - Search:

Cookbook

PmWiki

pmwiki.org

Backlinks

Summary: List pages with links to a target
Version: n/a
Prerequisites: pmwiki-2.0.0

Status: Documentation

Maintainer: Pm
Votes:

Question

  • How do I list the pages that link (backlink) to a certain page?
  • How do I find the pages that are linked to the current one?
  • How do I implement Wikipedia's "What links here" feature?

Description

PmWiki implements backlinks using the pagelist directive and its link= parameter. Here's an example showing the first ten pages pmwiki.org that link to the main Cookbook page:

(:pagelist link=Cookbook.Cookbook count=10:)
...
Backup /
CookbookBasics  Explains what the cookbook and its recipes are.
Cookbook /
ASCIIMath  Display MathML rendered ascii formula into PmWiki 2.x pages (Stable)
AttachLinks  Get Attach: links to display by default without the "Attach:" prefix
CookbookBasics  Explains what the cookbook and its recipes are.
DynamicPageActions  Dynamic PageActions
ExportHTML  Export PmWiki pages as "static" HTML pages
HandleICal  Add-on for wikicalendars to export/import events to/from ical-files (Beta)
ICalExport  Export wikicalender entries as ical file (stable)
ListOfBundles  List of commonly and successfully bundled recipes
ModuleGuidelines  Guidelines for creating, distributing, and maintaining a recipe for the Cookbook.

...

Here's a way to create a simple list of links back to the current page:

(:pagelist link={*$FullName} fmt=simple:)

Here is a link you could include in your SideBar or as an "action link" in one of your skin's menus, as done on this site with the Gemini, FixFlow, and Lens skins. You can get a list of pages linking to the current page with just a click:

* [[{*$Name}?action=search&q=link={*$FullName} | $[Backlinks] ]]

To include such a link in a skin template which does not use wiki pages for configuration of action links, you can add the following code to the skin template:

<a href='$PageUrl?action=search&q=link=$FullName'>$[Backlinks]</a>

Notes

Comments

The fmt=simple parameter works nicely in SideBar and "action" links:

[[{$Name}?action=search&q=fmt=simple+link={$FullName}|Backlinks]]

Backlinks

Shouldn't this recipe be obsoleted and redirect to PmWiki.PageLists#pagelistlink? —Eemeli Aro August 10, 2009, at 03:42 AM

See Also

Contributors

User notes +1: If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.

Edit - History - Print - Recent Changes - Search
Page last modified on September 10, 2011, at 11:42 AM