|
|
| Line 1: |
Line 1: |
| {{#vardefine: mainpagetitle | {{#ifeq: {{NAMESPACENUMBER}} | 0 | {{BASEPAGENAME}} | {{NAMESPACE}}:{{BASEPAGENAME}} }} }}
| | <!-- Simple test template below --> |
| | | {{#if: {{#ifeq: {{PAGENAME}} | {{BASEPAGENAME}}/editcopy | 1 | 0 }} | |
| <!-- Debug: PAGENAME={{PAGENAME}}, BASEPAGENAME={{BASEPAGENAME}}, mainpagetitle={{#var:mainpagetitle}} --> | | <div style="border: 2px solid green; padding: 10px; margin: 10px 0; background: lightgreen;"> |
| | | <strong>✓ POSITIVE:</strong> We are on editcopy page!<br> |
| {{#ifeq: {{PAGENAME}} | {{BASEPAGENAME}}/editcopy | <!-- The MessageBox only appears on the /editcopy page, allowing it to be used on the main page to prevent the main page and the editcopy from appearing different | | PAGENAME: {{PAGENAME}}<br> |
| | | BASEPAGENAME: {{BASEPAGENAME}}<br> |
| --> {{#if: {{{styles_editcopy|}}} | <templatestyles src="{{{styles_editcopy}}}" /> }}<!-- Load custom styles for editcopy page if specified
| | NAMESPACE: {{NAMESPACE}}<br> |
| | | NAMESPACENUMBER: {{NAMESPACENUMBER}}<br> |
| --> {{MessageBox
| | {{#if: {{#var:mainpagetitle}} | mainpagetitle variable: {{#var:mainpagetitle}} | mainpagetitle variable: NOT SET }} |
| |image = Book and Quill JE2 BE2.png
| | </div> |
| |text = This page is for users to propose changes to [[{{#var: mainpagetitle}}|{{#if: {{{firsttitle|}}} | {{{firsttitle|}}} | {{{1|{{#var: mainpagetitle}}}}} }}]]. The {{#if: {{{pagetype|}}} | {{{pagetype|}}} | {{#switch: {{NAMESPACENUMBER}} | 0 = article | 4 = project page | 6 = file | 10 = template | 14 = category | {{#ifexpr: {{NAMESPACENUMBER}} mod 2 = 0 | page | talk page}} }} }} "{{#if: {{{1|}}} | {{{1|}}} | {{BASEPAGENAME}} }}" is protected so that only {{{2|users with certain privileges}}} can edit it, {{#if: {{{reason|}}} | {{{reason|}}} | likely due to being a high traffic page or a target of vandalism }}. <!-- Explains the reason why the editcopy exists
| | | |
| | | <div style="border: 2px solid red; padding: 10px; margin: 10px 0; background: lightcoral;"> |
| --> <div style="line-height: 100%; text-align: center; font-size: 85%;"><br>
| | <strong>✗ NEGATIVE:</strong> We are NOT on editcopy page!<br> |
| [{{fullurl:Special:ComparePages|page1={{urlencode:{{#var: mainpagetitle}} }}&page2={{urlencode:{{FULLPAGENAME}} }} }} Diff with main page] {{#if: {{{extratext|}}}{{{3|}}} | • {{{extratext|{{{3}}}}}} }}</div> <!-- Compares the editcopy to the main page and adds an extra parameter for users of this template to provide extra information
| | PAGENAME: {{PAGENAME}}<br> |
| | | BASEPAGENAME: {{BASEPAGENAME}}<br> |
| --> }} <!-- End of MessageBox -->
| | Expected: {{BASEPAGENAME}}/editcopy<br> |
| | | {{#if: {{#var:mainpagetitle}} | mainpagetitle variable: {{#var:mainpagetitle}} | mainpagetitle variable: NOT SET }} |
| <!-- We are on the main page -->
| | </div> |
| {{#if: {{{styles_main|}}} | <templatestyles src="{{{styles_main}}}" /> }}<!-- Load custom styles for main page if specified | | }} |
| | |
| --> {{#if: {{{nocat|}}} | | [[Category:Editcopies]]}} <!-- Adds to Category:Editcopies unless the nocat parameter is specified
| |
| | |
| --> }} <!-- End of #ifeq/template --><noinclude>
| |
| === Documentation ===
| |
| Examples:
| |
| <syntaxhighlight lang="wikitext">
| |
| {{Editcopy
| |
| | Page Name
| |
| | administrators
| |
| | reason = high traffic page
| |
| }}
| |
| </syntaxhighlight>
| |
| <syntaxhighlight lang="wikitext">
| |
| {{Editcopy
| |
| | Main Page
| |
| | firsttitle = the main page
| |
| | administrators
| |
| | reason = because it is a high traffic page and therefore a likely target of vandalism
| |
| | extratext = See also editcopy pages for related templates.
| |
| | styles_main = :Main_Page/styles.css
| |
| | styles_editcopy = :Main_Page/styles.css/editcopy
| |
| }}
| |
| </syntaxhighlight>
| |
| | |
| [[Category:Maintenance templates]]
| |
| | |
| [[ru:Template:Editcopy]]
| |
| | |
| </noinclude>
| |
✓ POSITIVE: We are on editcopy page!
PAGENAME: Editcopy
BASEPAGENAME: Editcopy
NAMESPACE: Template
NAMESPACENUMBER: 10
mainpagetitle variable: NOT SET