Pinned Child Pages Application

Last modified by Admin on 2024/07/15 00:04

cogAllows to pin subpages in a specific order
TypeXAR
CategoryApplication
Developed by

slauriere

Active Installs2
Rating
1 Votes
LicenseGNU Lesser General Public License 2.1

Installable with the Extension Manager

Description

This application allows to define a specific order across a set of child pages of a given page. It introduces XClass PinnedChildPagesClass and it provides visual widget for ordering pages visually and a listener which updates PinnedChildPagesClass objects automatically on page move or removal.

Usage example

Basic usage

  • Add PinnedChildPagesClass object to a page having children
  • Fill in the field Pinned child pages of this object with a set of pages
  • The list of ordered child pages with pinned pages first then the other child pages except WebPreferences can be obtained via a call to the PinnedChildPagesScriptService as follows: $services.pinnedChildPages.getChildren($doc.documentReference).

Visual ordering widget

  • Create an AWM Book application with a simple Title field
  • Edit BookTemplate and add object XWiki.PinnedChildPagesClass to it
  • Create a Book entry, eg "Alice in Wonderland", and a few subpages representing the book chapters: "Down the Rabbit-Hole", "The Pool of Tears", "A Caucus-Race and a Long Tale"
  • Customize BookSheet as follows:
    • Include application macros: {{include reference="XWiki.PinnedChildPagesMacros"/}}
    • Add the following block to the form part:
        <dt>Chapters</dt>
       #if ($editing)
          <dd>#displaySortableChildren($doc.documentReference)</dd>
       #else
          <dd>
         #set ($chapters = $services.pinnedChildPages.getChildren($doc.documentReference))
         #foreach ($chapter in $chapters)
           #set ($chapterPage = $xwiki.getDocument($chapter))
            1. [[$chapterPage.displayTitle>>$chapter]]
         #end
          </dd>
       #end
  • Edit page "Alice in Wonderland", you should see the widget below for ordering child pages via drag and drop

child-pages-ordering.jpg

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

Release Notes

v1.3

v1.2

v1.1

v1.0

Initial release

Dependencies

Dependencies for this extension (org.xwiki.contrib:application-pinnedchildpages-ui 1.3):

  • org.xwiki.contrib:application-pinnedchildpages-api 1.3

Get Connected