Page MenuHomePhabricator

Allow PageTitlesControl to be filtered by namespace
Open, Needs TriagePublicFeature

Description

As a developer who wants to use CommunityConfig to allow a community to designate a list of "featured templates" (WIP patch), I would like to limit the titles entered using a PageTitlesControl to just those in the 'Template' namespace, so that users do not accidentally add other namespace pages.


Schema as it stands, for reference

class FeaturedTemplatesSchema extends JsonSchema {
	public const VERSION = '1.0.0';

	public const FeaturedTemplates = [
		self::TYPE => self::TYPE_ARRAY,
		self::DEFAULT => [],
		self::ITEMS => [
			self::TYPE => self::TYPE_OBJECT,
			self::PROPERTIES => [
				'titles' => [
					self::REF => [
						'class' => MediaWikiDefinitions::class,
						'field' => 'PageTitles',
					],
				],
			],
			self::REQUIRED => [ 'titles' ],
		],
	];
}