User:Patrick/Transclusion depth test

From Wikipedia, the free encyclopedia

Transclusion depth test:

Depth Result
{{Transclusion depth test/{{#expr: {{{maxdepth|40}}} - 1 }} | level = 0 | 1 = {{{1}}} }}

This template is used in the investigation of template depth limits.

It calls subtemplate /39, which produces row 0 and calls /38 which produces row 1 and calls /37, etc.

The examples show that the complexity of the expression for parameter 1 does not make any difference for the number of levels of subtemplates without error. Also, putting the call in the then- or else-part of #if does not make a difference. However, putting the call in a template parameter reduces the number of levels of subtemplates without error by 1.

Usage[edit]

{{Patrick | {{some template| ... }} }}

Maximum depth[edit]

To limit the maximum depth of the test, set maxdepth to a value between 0 and 40.

{{Patrick | maxdepth = num | {{some template| ... }} }}

The default value for maxdepth is 40.

See also[edit]

}}

Examples[edit]

{{transclusion depth test|tdt}}

{{transclusion depth test|{{#if:x|tdtifx}}}}

{{transclusion depth test|{{1x|tdt1x}}}}

{{#if:x|{{transclusion depth test|ifxtdt}}}}

{{1x|{{transclusion depth test|1xtdt}}}}

{{1x|{{1x|{{transclusion depth test|1x1xtdt}}}}}}

{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{transclusion depth test|20times1xtdt}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}

{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{1x|{{transclusion depth test|36times1xtdt}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}