cogDisplays the list of orphaned pages.
Type
Category
Developed by

Manuel Leduc

Rating
0 Votes
LicenseGNU Lesser General Public License 2.1

Table of contents

Description

The Orphaned Pages Panel displays the list of orphaned pages of the wiki.

The query below is proposed with a limit of 20 to avoid the generation of a large panel content that could slow down the page load time when the wiki contains many orphaned pages.

The query also does not include the hidden documents. They can be included by removing the hidden/document filter.

Code

{{velocity}}
#panelheader($services.localization.render('xe.panels.orphaned'))
#set ($homepage = $services.wiki.getById($services.wiki.currentWikiId).mainPageReference)
#set ($homepageFullName = $services.model.serialize($homepage, 'local'))
#set ($query = $services.query.xwql('where doc.parent is null or doc.parent='''' and doc.fullName <> :homepage order by doc.name asc'))
#set ($items = $query.bindValue('homepage', $homepageFullName).addFilter('hidden/document').setLimit(20).execute())
#foreach ($item in $items)
 #if ($xwiki.hasAccessLevel('view', $xcontext.user, "${xcontext.database}:${item}"))
   #set ($bentrydoc = $xwiki.getDocument($item))
    * [[${bentrydoc.fullName}]]
 #end
#end
#panelfooter()
{{/velocity}}

Screenshot

Screenshot_2021-02-09 aaa - XWiki.png

Tags:
     

Get Connected