Difference between revisions of "DPL Example 007"
From FollowTheScore
Line 3: | Line 3: | ||
Ideally we would like to use a template which calls itself recursively. But MediaWiki tries to be clever and blocks such calls. So we have to use a separate template for each level. So, if you need more than two levels you must ''copy the source code'' of [[Template:DPL Example 007 sub 2]] to ''Template:DPL Example 007 sub 3'' etc. | Ideally we would like to use a template which calls itself recursively. But MediaWiki tries to be clever and blocks such calls. So we have to use a separate template for each level. So, if you need more than two levels you must ''copy the source code'' of [[Template:DPL Example 007 sub 2]] to ''Template:DPL Example 007 sub 3'' etc. | ||
+ | |||
+ | You could redirect your (super-)category page to a page which contains the following call. The readers would then automatically always see the pages belonging to subcategories. | ||
<pre><nowiki> | <pre><nowiki> |
Revision as of 23:11, 9 March 2009
back to list of examples
Show members of a category and of all its subcategories
Ideally we would like to use a template which calls itself recursively. But MediaWiki tries to be clever and blocks such calls. So we have to use a separate template for each level. So, if you need more than two levels you must copy the source code of Template:DPL Example 007 sub 2 to Template:DPL Example 007 sub 3 etc.
You could redirect your (super-)category page to a page which contains the following call. The readers would then automatically always see the pages belonging to subcategories.
{{DPL Example 007 sub|DPL Example 007 main cat}}
The above DPL command produces the following output:
Pages in category DPL Example 007 main cat
|
Pages in subcategory DPL Example 007 sub cat 1
|
Pages in subcategory DPL Example 007 sub cat 2