Jump to content

Template:Editnotice load/doc: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
+vi: (includeonly)
No edit summary
 
(12 intermediate revisions by 11 users not shown)
Line 1: Line 1:
{{documentation subpage}}
{{documentation subpage}}
{{used in system}}
{{used in system}}
{{cascade-protected template}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->


Line 7: Line 8:
This template is normally only used by the system, it is the [[Wikipedia:Editnotice|editnotice]] loader used in MediaWiki. It displays the editnotices and the links to them, at the top of pages when editing pages.
This template is normally only used by the system, it is the [[Wikipedia:Editnotice|editnotice]] loader used in MediaWiki. It displays the editnotices and the links to them, at the top of pages when editing pages.


=== Technical details ===
== Technical details ==


This template loads and displays the namespace notice. It also calls the sub-template {{tl|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 loads and displays the namespace notice. It also calls the sub-template {{tl|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.
Line 13: Line 14:
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.
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.


==== The links ====
=== The links ===


When a page is edited this template often displays red or blue links at the top of the edit page looking like this:
When a page is edited this template often displays red or blue links at the top of the edit page looking like this:
Line 25: Line 26:
{{clear}}
{{clear}}


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 only see the red "Page notice" link on their own user and user talk basepage, 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.
Those links are to the group and page editnotices of the page. Admins, page movers and template editors always see both links, even if the notices have not yet been created, since they can create and edit the editnotices. Normal users only see the red "Page notice" link on their own user and user talk basepage, 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 ====
=== 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.
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.
Line 33: Line 34:
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 "<code>notice action = view</code>" to the editnotices it loads when in view mode. This can be used inside the editnotices like this:
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 "<code>notice action = view</code>" to the editnotices it loads when in view mode. This can be used inside the editnotices like this:


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


=== See also ===
== TemplateData ==
{{TemplateData header}}
{{#invoke:TNT|doc|editnotice load}}

== See also ==


* [[Wikipedia:Editnotice]] – About the editnotice system.
* [[Wikipedia:Editnotice]] – About the editnotice system.
<includeonly>{{Sandbox other||

<includeonly>
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
[[Category:Wikipedia editnotices| ]]
[[Category:Wikipedia editnotices| ]]
[[Category:MediaWiki namespace templates]]
[[Category:MediaWiki namespace templates]]
}}</includeonly>

[[it:Template:Editnotice load]]
[[pl:Szablon:Dołącz editnotice]]
[[vi:Bản mẫu:Thông báo sửa đổi của trang]]
</includeonly>

Latest revision as of 18:20, 30 August 2024

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

[edit]

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.

[edit]

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, page movers and template editors always see both links, even if the notices have not yet been created, since they can create and edit the editnotices. Normal users only see the red "Page notice" link on their own user and user talk basepage, 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

[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-->
}}

TemplateData

[edit]
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Editnotice load in articles based on its TemplateData.

TemplateData for Editnotice load

The editnotice loader used in the “MediaWiki:Editnotice-*” messages.

Template parameters

ParameterDescriptionTypeStatus
Notice Actionnotice action

Set to “view” when the current page is protected and the current user doesn’t have the required permissions to edit the page.

Example
view
Linesuggested

Edit parameter translations

See also

[edit]
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy