Anonymous

Template:Includeparent: Difference between revisions

From OER in Education
no edit summary
No edit summary
No edit summary
Line 9: Line 9:


On a page called PAGE/localcode/pv, PAGE is included, on a page called PAGE/pv, PAGE is included.
On a page called PAGE/localcode/pv, PAGE is included, on a page called PAGE/pv, PAGE is included.
if you add
|diag=1
then some diagnostic information is printed at the end of the page.
</noinclude>{{#vardefine:includeparent|yes}}<!--
</noinclude>{{#vardefine:includeparent|yes}}<!--
-->{{#ifeq: {{#titleparts: {{PAGENAME}} | |-1}}|pv|{{#vardefine:ispv|yes}}{{#vardefine:includeparentdepth|-2}}|{{#vardefine:ispv|no}}{{#vardefine:includeparentdepth|-1}}}}<!--
-->{{#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}} |1| {{#var:includeparentdepth}} }}
|zm={{#vardefine:islocal|yes}}{{#vardefine:localcode|zm}}
|zm={{#vardefine:islocal|yes}}{{#vardefine:localcode|zm}}
|ke={{#vardefine:islocal|yes}}{{#vardefine:localcode|ke}}
|ke={{#vardefine:islocal|yes}}{{#vardefine:localcode|ke}}
Line 19: Line 23:
|#default ={{#vardefine:islocal|no}}
|#default ={{#vardefine:islocal|no}}
}}<!--
}}<!--
-->{{: {{#titleparts: {{PAGENAME}} | {{#var:includeparentdepth}} }} }}
-->{{: {{#titleparts: {{PAGENAME}} | {{#var:includeparentdepth}} }} }}<!--
-->{{ifeq: {{{diag|}}}|1|
* includeparent: {{#var:includeparent}}
* titleparts - 1 = {{#titleparts: {{PAGENAME}} | |-1}}
* titleparts - 2 = {{#titleparts: {{PAGENAME}} |1|-2}}
* ispv = {{#var:ispv}}
* includeparentdepth = {{#var:includeparentdepth}|
* #titleparts: PAGENAME | 1 | includeparentdepth= {{#titleparts:{{PAGENAME}} | 1 | {{#var:includeparentdepth}} }}
* islocal = {{#var:isloca}}
* localcode = {{#var:localcode}}
}}