Difference between revisions of "DPL Example 008"

From FollowTheScore
Jump to: navigation, search
 
(5 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
{{Example|Category tree}}
 
{{Example|Category tree}}
  
This is just for demonstration what can be done (there is a separate etension for that purpose). You can easily adapt the format, add conditions etc.
+
This is a simple demonstration of what can be done. The DPL statement could be moved to a separate template in the way [[DPL Example 007]] was designed.
 +
 
 +
If you need a general category tree you better use the separate extension which is available exactly for that purpose. But if you want individual design, hide certain categories etc. then the DPL based solution is more flexible.
  
 
<pre><nowiki>
 
<pre><nowiki>
 
{{#tree:
 
{{#tree:
{{DPL Example 008 sub|DPL Example 007 main cat}}
+
* Pages in category &nbsp; &nbsp; '' DPL Example 007 main cat ''
 +
{{#dpl:debug=1|notnamespace=Category|format=,\n** [[%PAGE%|%TITLE%]]|category=DPL Example 007 main cat}}
 +
** Pages in category &nbsp; &nbsp; '' DPL Example 007 sub cat 1''
 +
{{#dpl:debug=1|notnamespace=Category|format=,\n*** [[%PAGE%|%TITLE%]]|category=DPL Example 007 sub cat 1}}
 +
** Pages in category &nbsp; &nbsp; '' DPL Example 007 sub cat 2''
 +
{{#dpl:debug=1|notnamespace=Category|format=,\n*** [[%PAGE%|%TITLE%]]|category=DPL Example 007 sub cat 2}}
 
}}
 
}}
 
</nowiki></pre>
 
</nowiki></pre>
Line 15: Line 22:
  
 
{{#tree:
 
{{#tree:
{{DPL Example 008 sub|DPL Example 007 main cat}}
+
* Pages in category &nbsp; &nbsp; '' DPL Example 007 main cat ''
 +
{{#dpl:debug=1|notnamespace=Category|format=,\n** [[%PAGE%|%TITLE%]]|category=DPL Example 007 main cat}}
 +
** Pages in category &nbsp; &nbsp; '' DPL Example 007 sub cat 1''
 +
{{#dpl:debug=1|notnamespace=Category|format=,\n*** [[%PAGE%|%TITLE%]]|category=DPL Example 007 sub cat 1}}
 +
** Pages in category &nbsp; &nbsp; '' DPL Example 007 sub cat 2''
 +
{{#dpl:debug=1|notnamespace=Category|format=,\n*** [[%PAGE%|%TITLE%]]|category=DPL Example 007 sub cat 2}}
 +
}}
 +
 
 +
---
 +
Another category overview
 +
---
 +
{{#tree:
 +
{{#dpl:debug=1|notnamespace=Category|format=,\n** [[%PAGE%|%TITLE%]]|category=Fictitious country}}
 
}}
 
}}

Latest revision as of 15:05, 14 April 2009

back to list of examples

Category tree

This is a simple demonstration of what can be done. The DPL statement could be moved to a separate template in the way DPL Example 007 was designed.

If you need a general category tree you better use the separate extension which is available exactly for that purpose. But if you want individual design, hide certain categories etc. then the DPL based solution is more flexible.

{{#tree:
* Pages in category     '' DPL Example 007 main cat ''
{{#dpl:debug=1|notnamespace=Category|format=,\n** [[%PAGE%|%TITLE%]]|category=DPL Example 007 main cat}}
** Pages in category     '' DPL Example 007 sub cat 1''
{{#dpl:debug=1|notnamespace=Category|format=,\n*** [[%PAGE%|%TITLE%]]|category=DPL Example 007 sub cat 1}}
** Pages in category     '' DPL Example 007 sub cat 2''
{{#dpl:debug=1|notnamespace=Category|format=,\n*** [[%PAGE%|%TITLE%]]|category=DPL Example 007 sub cat 2}}
}}

The above DPL command produces the following output:


{{#tree:

  • Pages in category     DPL Example 007 main cat

}}

--- Another category overview --- {{#tree:

}}