Orphaned Pages Panel
Last modified by Manuel Leduc on 2026/06/02 17:55
| Displays the list of orphaned pages. |
| Type | |
| Category | |
| Developed by | |
| Rating | |
| License | GNU 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
