Jump to content

Template:Editnotice load/doc: Difference between revisions

From Simple English Wikipedia, the free encyclopedia
Content deleted Content added
View source or edit: Changed "in editnotices" to "inside the editnotices".
Line 46: Line 46:
<includeonly>
<includeonly>
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
[[Category:Wikipedia editnotices| ]]
[[Category:MediaWiki namespace templates]]
[[Category:MediaWiki namespace templates]]



Revision as of 08:30, 8 January 2010

This is the {{editnotice load}} template.

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

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. While 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 Wikipedia:Namespace for the full list of namespace numbers. Then this template needs no parameter.

When a page is edited this template often displays red or blue links at the top of the edit page looking like this:

Or like this:

Those links are to the group and page editnotices of the page. Admins and accountcreators always see both links, even if the notices have not yet been created, since they can create and edit the editnotices. Normal users see the red "Page notice" links only on user and user talk basepages, since they can create and edit such notices. Normal users also see blue links to group and page notices if they already have been created, so they can find and view the source code of the notice. But normal users still can't edit those notices, except the ones in userspace.

View source or edit

We are planning to make it so 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 will be 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 will feed "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-->
}}

See also