User:MGrosse-WMF/drafts/CCTechDocsUpdates

From mediawiki.org

Available Controls[edit]

Currently, support for a number of basic controls and some complex controls is being implemented and thus available for use in a JsonSchema. Each type comes with associated interface messages, some of which are required and some are optional.

Boolean[edit]
<?php

namespace CommunityConfigurationExample\Schemas;

use MediaWiki\Extension\CommunityConfiguration\Schema\JsonSchema;

class ExampleSchema implements JsonSchema {
	public const ExampleConfigOption = [
		self::TYPE => self::TYPE_BOOLEAN
	];
}

All messages have the following prefix: communityconfiguration-<name of the provider in all lowercase>-<name of the schema constant in all lowercase> and a specific suffix:

  • -label: (optional) general title of the section, should often be skipped for boolean controls
  • -control-label: required, the actual label of the checkbox, this will be read out by screen readers as the label of the checkbox and is what is actually clickable with the mouse
  • -help-text: (optional) additional general help text for the section