Backlinks
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?
- Can this list of backlinks show at the bottom of every page, automatically?
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:) ... |
Only search in group: Backup (1), Cookbook (26), CookbookFr (2), Magazine (1), News (3), PITS (10), PmWiki-DITA (1), PmWiki (33), PmWikiBg (1), PmWikiCa (5), PmWikiDa (1), PmWikiDe (23), PmWikiEl (1), PmWikiEo (1), PmWikiEs (1), PmWikiFr (7), PmWikiIt (1), PmWikiJa (1), PmWikiNl (1), PmWikiPtBr (4), PmWikiRu (5), PmWikiSk (1), PmWikiVi (2), PmWikiZhCn (7), PmWikiZhTw (5), Profiles (8), Site (4), Test (6), TestBlog (1), ViewModes (1), WikiSpheres (1) ... |
Here's a way to create a simple list of links back to the current page:
If you place this directive in a GroupFooter page, it will appear in all pages of the same WikiGroup.
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
See Also
- PmWiki.PageLists
- MarkupMasterIndex#PageLists
- PageListMultiTargets Enable multiple pages and wildcards in PageList
Contributors
Comments
See discussion at Backlinks-Talk
User notes +3: 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.