Template:Example: Difference between revisions
Content added Content deleted
imported>FrozenPlum m (Found anchorencode magic word to fix link when specified by base param) |
imported>FrozenPlum m (Thought I had fixed this, but maybe I didn't save as I thought I had, or made some other error while doing it (likely) hopefully this remedies) |
||
Line 2: | Line 2: | ||
{{#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"> |
||
[{{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}}) Test in sandbox] |
||
</div>}} |
</div>}} |
||
<div class="demo-viewpage"> |
<div class="demo-viewpage"> |
||
Line 10: | Line 10: | ||
==Tests== |
==Tests== |
||
# <code><nowiki>{{example|category|base=Criteria for page selection|eg=2}}</nowiki></code> gives: {{example|category|base= |
# <code><nowiki>{{example|category|base=Criteria for page selection|eg=2}}</nowiki></code> gives: {{example|category|base=Criteria for page selection|eg=2}} |
||
<ol> |
<ol> |
||
<li value="2"><code><nowiki>{{example|category|base=Criteria for page selection|nosandbox=y}}</nowiki></code> gives: {{example|category|base= |
<li value="2"><code><nowiki>{{example|category|base=Criteria for page selection|eg=2|nosandbox=y}}</nowiki></code> gives: {{example|category|base=Criteria for page selection|eg=2|nosandbox=y}}</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}}</nowiki></code> gives: {{example|category|base=Criteria for page selection|eg=2}}</li> |
||
</ol> |
</ol> |
||
Revision as of 00:21, 16 April 2022
Tests
{{example|category|base=Criteria for page selection|eg=2}}
gives:
{{example|category|base=Criteria for page selection|eg=2|nosandbox=y}}
gives:{{example|category|base=Criteria for page selection|eg=2}}
gives: