Feature #3879

"What Links Here" in right hand column

Added by Ben Oakes about 13 years ago. Updated over 7 years ago.

Status:NewStart date:2009-09-16
Priority:NormalDue date:
Assignee:-% Done:


Target version:-


Similar to Wikipedia, it'd be nice to have a list of all the wiki pages that link to the wiki page currently being viewed. For example, it could look like the following:


  • Start page
  • Index by title
  • Index by date

What Links Here

  • Wiki Page 1
  • Wiki Page 2
  • ...
  • Wiki Page N

Without this, it's hard to tell where to go for related information.

Related issues

Related to Redmine - Feature #16996: Reciprocal links (or, "Related wiki pages") New


#1 Updated by Emp Imp over 12 years ago

I second this request.

#2 Updated by Ben Oakes over 12 years ago

I thought about this with a colleague the other day. Here's a sketch of how it might work, if anyone wants to implement it.


  • A page_links join table (two columns, something like: source_page and linked_page)
  • An observer on the wiki page model
  • A method on the wiki page parser that gives an array of links

On save, the source page would delete all its rows in page_links, parse the new page content for links, and update the join table with which pages are now linked.

To display "what links here", all that would be needed is a query to give all page_links rows with a linked_page of the currently viewed page. The pages that link to that page are the source_page values in the result of that query.


page_links has no rows.

I create a page called "foo" with this content:

This is a page about foo. Related topics: [[bar]], [[baz]].

page_links then has:

source_page linked_page
foo bar
foo baz

Then, I create a page named "bar":

This is a page about bar.

To find the pages that link to "bar", I query for page_links with a linked_page of "bar". Result:

source_page linked_page
foo bar

So, "foo" is the only page that links to "bar".

#3 Updated by Tiago Carvalho (LabOrders) over 7 years ago


Please see also #16996 [Reciprocal links (or, "Related wiki pages")]

#4 Updated by Toshi MARUYAMA over 7 years ago

  • Related to Feature #16996: Reciprocal links (or, "Related wiki pages") added

Also available in: Atom PDF