Currently this is disallowed in PagesTagParser.php:
// abort if the tag is on an index or a page page if ( $pageTitle->inNamespace( $this->context->getIndexNamespaceId() ) || $pageTitle->inNamespace( $this->context->getPageNamespaceId() ) ) { return ''; }
@Tpt Is there a technical reason for this? The code dates way back to 2009:
commit 85b903a0d937be50012765f41d46ba1a19925ddc Author: ThomasV <thomasv@users.mediawiki.org> Date: Thu Sep 24 21:48:02 2009 +0000 do not allow 'pages' command on index pages diff --git a/ProofreadPage.php b/ProofreadPage.php --- a/ProofreadPage.php +++ b/ProofreadPage.php @@ -714,0 +714,4 @@ + # abort if the tag is on an index page + if ( preg_match( "/^$index_namespace:(.*?)(\/([0-9]*)|)$/", $wgTitle->getPrefixedText() ) ) { + return ""; + }
It would be more consistent for users if we could use <pages/> on index pages too, since pages are often transcluded for TOCs in indexes.
Misuse of direct {{page:}} transclusion is a constant thing, and fewer legitimate uses of {{page:}} makes messaging clearer. Plus, it's easier to use ranges than copy-pasting n pages.