Template:Includeparent: Difference between revisions

From OER in Education
No edit summary
No edit summary
Line 1: Line 1:
{{#vardefine:includeparent|yes}}<!--
<noinclude>
-->{{#ifeq: {{#titleparts: {{PAGENAME}} | |-1}}|pv|{{#vardefine:ispv|yes}}{{#vardefine:includeparentdepth|-2}}|{{vardefine:ispv|no}}{{vardefine:includeparentdepth|-1}}}}<!--
If a page is generated using this template, then #var:includeparent = yes
 
If a page is a PV page, then #var:ispy = yes, otherwise no
 
If the page is a localised page #var:islocal = yes, otherwise no
 
If the page is local, #var:localcode = zm, ke, rw, sl, ug, etc.
 
On a page called PAGE/localcode/pv, PAGE is included, on a page called PAGE/pv, PAGE is included.
</noinclude>{{#vardefine:includeparent|yes}}<!--
-->{{#ifeq: {{#titleparts: {{PAGENAME}} | |-1}}|pv|{{#vardefine:ispv|yes}}{{#vardefine:includeparentdepth|-2}}|{{#vardefine:ispv|no}}{{#vardefine:includeparentdepth|-1}}}}<!--
-->{{#switch: {{#titleparts:{{PAGENAME}} | | {{#var:includeparentdepth}}  
-->{{#switch: {{#titleparts:{{PAGENAME}} | | {{#var:includeparentdepth}}  
|zm={{#vardefine:islocal|yes}}{{#vardefine:localcode|zm}}
|zm={{#vardefine:islocal|yes}}{{#vardefine:localcode|zm}}

Revision as of 19:21, 7 January 2015

If a page is generated using this template, then #var:includeparent = yes

If a page is a PV page, then #var:ispy = yes, otherwise no

If the page is a localised page #var:islocal = yes, otherwise no

If the page is local, #var:localcode = zm, ke, rw, sl, ug, etc.

On a page called PAGE/localcode/pv, PAGE is included, on a page called PAGE/pv, PAGE is included. {{#switch: Includeparent{{: }}