cogCreate and display relations between pages as XWiki objects
Developed by

Anca Luca, Clément Aubin, Stéphane Laurière

Active Installs17
2 Votes
LicenseGNU Lesser General Public License 2.1

XWiki 10.4+

Installable with the Extension Manager


XWiki makes it possible to interlink pages in multiple ways: using embedded links, using a hierarchy via the nested pages feature, using tags or using structured objects. In some cases, it can be handy to have an additional way to link pages: as metadata added to the pages, using dedicated objects. It is typically useful when you want to navigate your wiki transversally rather than hierarchically, or when tags do not carry enough semantics, in particular due to the fact that tags cannot be tagged. The Page Relations application was created to ease the creation of relations between pages and the navigation of the wiki page graph.


Adding, removing, displaying relations

The application provides a user interface for adding or removing relations to a page and for displaying the current page's relations, as illustrated in the image below, in a way that is similar to the way tags can be listed/added/removed.


PageRelations Panel

The application provides a panel displaying the current page's direct and inverse relations, named PageRelations.Code.PageRelationsPanel.

PageRelations macro

The application provides a macro {{pageRelations/}} displaying the current page direct and inverse relations. The macro has two parameters:

  • showTitles: true for displaying the "Relations" and "Facets" labels in the interface, defaults to true.
  • showFacets: true for displaying second-level relations that are highly connected to first-level relations, a.k.a "facets", see paragraph below, defaults to false.


NB: a more self-explanatory term than "facet" is being looked for.

The facets of a given page are its second-level relations that are highly connected to at least one its first-level relations. In the illustration below, the following facets show up for the page "Movies": "Charlie Chaplin", "Comedy", "Drama". This means that among the pages that relate to the page "Movies", many of them (at least 4 by default) have a relation either to "Charlie Chaplin", "Comedy" or "Drama". The number of such relations is indicated between parentheses. Hitting that number acts a filter on the list of displayed relations: if you hit "Comedy", you will see all pages that have a relation to both pages "Movies" and "Comedy".



  • Automated creation of relations when page links are detected in the content.
  • Ability to name relations, e.g.: Page A "relates to" Page B, Page A "has type" Page B...
  • Automated suggestion of relations based on a natural language processing analysis of the content.
  • Ability to create relations between pages of different wikis.

See also

This paragraph lists some initiatives that relate to the management of relations or software that implements a feature allowing to relate artefacts with one another:

  • RDF proposes the concept of triples: subject - predicate - object, that's a way to relate the subject and the object.
  • JIRA allows to link issues with one another with one of the following properties: blocks, depends on, duplicates, relates to.


The code of this application reuses code developed for the Tag Application.

Prerequisites & Installation Instructions

We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.

You can also use the following manual method, which is useful if this extension cannot be installed with the Extension Manager or if you're using an old version of XWiki that doesn't have the Extension Manager:

  1. Log in the wiki with a user having Administration rights
  2. Go to the Administration page and select the Import category
  3. Follow the on-screen instructions to upload the downloaded XAR
  4. Click on the uploaded XAR and follow the instructions
  5. You'll also need to install all dependent Extensions that are not already installed in your wiki

For XWiki versions older than 10.4

This application requires the user interface extension point org.xwiki.platform.template.content.header.after, which was introduced in XWiki 10.4RC1. In order to add this extension point to a previous version of XWiki, edit the file "contentview.vm" as follows:

<div class="xcontent">
  #foreach ($uix in $services.uix.getExtensions('org.xwiki.platform.template.content.header.after'))
    $services.rendering.render($uix.execute(), 'xhtml/1.0')
  ## --------------------------------------------------------------------------
  ## Drop permissions as they are no longer needed. This allows us not to have
  ## to review the code below for security holes since nothing bad can happen.
  ## --------------------------------------------------------------------------
  ## ----------------------------
  ## Display the rendered content
  ## ----------------------------
 <div class="row">
   <div id="xwikicontent" class="col-xs-12">
      #if ("$!contentvmexception" != '')

Release Notes



    • Closed PAGEREL-28 An exception is raised when a page is deleted in a farm where not all the sub-wikis have the extension installed


    • Closed PAGEREL-24 Renaming pages having children with relations won't update the reverse relations
    • Closed PAGEREL-8 'Add new entry' not working from the Homepage
    • Closed PAGEREL-6 Automatically handle relations when the target page gets deleted


    • Closed PAGEREL-21 The automated rename message should be localized
    • Closed PAGEREL-20 Remove wiki name from the parent field of code pages
    • Closed PAGEREL-19 Remove "Page Relations" from the list of applications
    • Closed PAGEREL-18 Missing dependency from page-relations-ui to page-relations-api
    • Closed PAGEREL-17 Handle inverse relations when a document gets renamed



    • Closed PAGEREL-11 pagerelations macro displays an error in inline edit mode
    • Closed PAGEREL-9 Cannot create relations with pages that have dots '.' in their names
    • Closed PAGEREL-7 Missing icon, name and description for Relations entry in the Create step
    • Closed PAGEREL-3 Improve the picker for the page to relate to



    Dependencies for this extension (org.xwiki.contrib:application-page-relations-ui 2.4):

    • org.xwiki.contrib:application-page-relations-api 2.4
    Created by slauriere on 2018/05/12 18:40

    Get Connected