This page is protected against editing.

Template:Editnotice load

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search


Protected This template has been protected from editing to prevent vandalism.
Please discuss changes on the talk page or request unprotection.
Template documentationview · edit · history · purge ]
This documentation is transcluded from Template:Editnotice load/doc.

This template is normally only used by the system, it is the editnotice loader used in Commons. It displays the editnotices and the links to them, at the top of pages when editing pages.

Usage

{{editnotice load}}

Template parameters

<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData

TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard.


Existing template documentation
At Wikimedia Commons, it is recommended to use {{TemplateBox}} with either ‎useTemplateData=1 or ‎useTemplateData=only on the ‎/doc subpage and transcluding it with {{Documentation}} into the template. ‎<nowiki>-tags can be wrapped around the arguments, if required, to avoid templates being expanded.

Newly created template documentation and imports
Another option, especially for imported templates, or for users with JSON experience, is placing raw ‎<templatedata>-tags into the Wikitext of the template, as described in various Wikipediae.


Wikipedia's help about TemplateDataCommons-specific information

This template is normally only used by the system, it is the editnotice loader used in Commons. It displays the editnotices and the links to them, at the top of pages when editing pages.

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
notice actionnotice action

Should be “view” when viewing the source of a protected page

Lineoptional

Additional information

The template is intended to be used in the following namespaces: the MediaWiki namespace

The template is intended to be used by the following user groups: Administrators

See also

Technical details

This template loads and displays the namespace notice. It also calls the sub-template {{Editnotice load/core}}. That sub-template handles the loading of the group and page notices and the links to them. This template does parameter preprocessing, thus simplifying the code.

This template is placed in the main MediaWiki namespace notices named MediaWiki:Editnotice-0, MediaWiki:Editnotice-1 and so on. See Help:Namespaces for the full list of namespace numbers. Therefore this template needs no parameter.

View source or edit

The editnotices are also displayed when a user "views the source" of a protected page. (When a non-admin tries to edit a fully protected page, or when an IP-user tries to edit a semi or fully protected page.) The group and page notices are displayed, but not the namespace notices.

Most editnotices have useful information even when just viewing the source of a protected page, but in some cases we want to display different information to users who are just viewing the source of the page. This template feeds "notice action = view" to the editnotices it loads when in view mode. This can be used inside the editnotices like this:

{{#ifeq: {{{notice action|}}} | view
| <!--A non-admin is "viewing the source" of a protected page-->
| <!--A user with sufficient rights is editing the page-->
}}