Template:Example: Difference between revisions
Content deleted Content added
imported>FrozenPlum m Add a flag for no sandbox |
imported>FrozenPlum mNo edit summary |
||
(9 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
<templatestyles src="Example/style.css" /><!-- |
|||
<div class="demo-inputbox-wrapper"> |
--><includeonly><div class="demo-inputbox-wrapper"> |
||
{{#if:{{{nosandbox|}}}|<!-- has value don't display --><!-- otherwise display |
{{#if:{{{nosandbox|}}}|<!-- has value don't display --><!-- otherwise display |
||
-->|<div class="demo-viewpage"> |
-->|<div class="demo-viewpage" style="margin-top:{{{margin|}}};"> |
||
[{{fullurl:Special:Mypage/Sandbox|action=edit}}§ion=new&preloadtitle={{urlencode:{{{1}}}}}&preload={{#if:{{{base|}}}|{{{base}}}|{{urlencode:{{FULLPAGENAME}}}}}}/{{#if:{{{noparam|}}}|<!-- not empty -->|Parameter:_}}{{{1|}}}_(example{{#if:{{{eg|}}}|_{{{eg|}}}|_1}}) Test in sandbox] |
[{{fullurl:Special:Mypage/Sandbox|action=edit}}§ion=new&preloadtitle={{urlencode:{{{1}}}}}&preload={{#if:{{{base|}}}|{{anchorencode:{{{base}}}}}|{{urlencode:{{FULLPAGENAME}}}}}}/{{#if:{{{noparam|}}}|<!-- not empty -->|Parameter:_}}{{{1|}}}_(example{{#if:{{{eg|}}}|_{{{eg|}}}|_1}}) {{{2|Test in sandbox}}}] |
||
-- correct working URL (without params) -- |
|||
[{{fullurl:Special:Mypage/Sandbox|action=edit}}§ion=new&preloadtitle=New_Header&preload=Criteria for page selection/Example Test in sandbox]--> |
|||
</div>}} |
</div>}} |
||
{{#if:{{{noresult|}}}|<!-- has value don't display --><!-- otherwise display |
|||
<div class="demo-viewpage"> |
-->|<div class="demo-viewpage" style="margin-top:{{{margin|}}};"> |
||
[[{{#if:{{{base|}}}|{{ |
[[{{#if:{{{base|}}}|{{anchorencode:{{{base}}}}}|{{FULLPAGENAME}}}}/{{#if:{{{noparam|}}}|<!-- not empty -->|Parameter: }}{{{1|}}} (example{{#if:{{{eg|1}}}| {{{eg|1}}}}})|View Result]] |
||
</div> |
|||
</div> |
</div>}} |
||
</div></includeonly><noinclude> |
|||
==Tests== |
==Tests== |
||
⚫ | |||
<li><code><nowiki>{{example|category|base=Criteria for page selection|eg=2}}</nowiki></code> gives: {{example|category|base=Criteria for page selection|eg=2}}</li> |
|||
⚫ | |||
⚫ | |||
⚫ | |||
<li value="3"><code><nowiki>{{example|category|base=Criteria for page selection}}</nowiki></code> gives: {{example|category|base= |
<li value="3"><code><nowiki>{{example|category|base=Criteria for page selection|eg=2|noresult=y}}</nowiki></code> gives: {{example|category|base=Criteria for page selection|eg=2|noresult=y}}</li> |
||
<li value="4"><code><nowiki>{{example|category|base=Criteria for page selection|Link Text|eg=2|noresult=y|margin=.5em}}</nowiki></code> gives: {{example|category|base=Criteria for page selection|Link Text|eg=2|noresult=y|margin=.5em}}</li> |
|||
</ol> |
</ol> |
||
<!-- |
<!-- |
||
* Plain URL exampe: |
* Plain URL exampe (needed for later conversion, wanting to convert override for both): |
||
** [{{fullurl:Special:Mypage/Sandbox|action=edit}}§ion=new&preloadtitle=New_Header&preload=Criteria_for_page_selection/Parameter:_category_(example_1) Test in sandbox] |
** [{{fullurl:Special:Mypage/Sandbox|action=edit}}§ion=new&preloadtitle=New_Header&preload=Criteria_for_page_selection/Parameter:_category_(example_1) Test in sandbox] |
||
* {{urlencode:{{FULLPAGENAME}}}} |
* {{urlencode:{{FULLPAGENAME}}}} |
||
* {{PAGENAMEE}} --> |
* {{PAGENAMEE}} --> |
Latest revision as of 00:52, 2 October 2022
Page Template:Example/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").
Tests
{{example|category|base=Criteria for page selection|eg=2}}
gives: Page Template:Example/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").{{example|category|base=Criteria for page selection|eg=2|nosandbox=y}}
gives: Page Template:Example/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").{{example|category|base=Criteria for page selection|eg=2|noresult=y}}
gives: Page Template:Example/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").{{example|category|base=Criteria for page selection|Link Text|eg=2|noresult=y|margin=.5em}}
gives: Page Template:Example/style.css must have content model "Sanitized CSS" for TemplateStyles (current model is "plain text").