Template:DPL from category by category: Difference between revisions
No edit summary |
No edit summary |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly> | <includeonly> | ||
{{#if: {{{heading|{{{2|}}}}}} | == {{{heading|{{{2|List of pages in subcategories and crosscategories of [[:Category:{{{category|{{{1|}}}}}}]]}}}}}} | {{#if: {{{heading|{{{2|}}}}}} | =={{{heading|{{{2|List of pages in subcategories and crosscategories of [[:Category:{{{category|{{{1|}}}}}}]]}}}}}}== }} | ||
<span style="font-size:small;">This list is dynamically generated. Please don't try to edit it directly/manually, but see [[Template:DPL from category by category|here]] for how to get your page included.</span> | <span style="font-size:small;">This list is dynamically generated. Please don't try to edit it directly/manually, but see [[Template:DPL from category by category|here]] for how to get your page included.</span> | ||
Line 6: | Line 6: | ||
{{#DPL: | {{#DPL: | ||
| category=*{{{category|{{{1|}}}}}} | | category=*{{{category|{{{1|}}}}}} | ||
| {{#if: {{{notopcategory|{{{4|}}}}}} | category=-{{{category|{{{1|}}}}}} }} | |||
| ordermethod=category,sortkey | | ordermethod=category,sortkey | ||
| headingmode=ordered | | headingmode=ordered | ||
| namespace={{{namespace|{{{3|}}}}}} | | namespace={{{namespace|{{{3|}}}}}} | ||
| notcategory={{{exclude category|{{{ | | notcategory={{{exclude category|{{{5|}}}}}} | ||
| notcategory={{{exclude category 1|{{{ | | notcategory={{{exclude category 1|{{{6|}}}}}} | ||
| notcategory={{{exclude category 2|{{{ | | notcategory={{{exclude category 2|{{{7|}}}}}} | ||
| notcategory={{{exclude category 3|{{{ | | notcategory={{{exclude category 3|{{{8|}}}}}} | ||
| notcategory={{{exclude category 4|{{{ | | notcategory={{{exclude category 4|{{{9|}}}}}} | ||
| notcategory={{{exclude category 5|{{{ | | notcategory={{{exclude category 5|{{{10|}}}}}} | ||
| notcategory={{{exclude category 6|{{{ | | notcategory={{{exclude category 6|{{{11|}}}}}} | ||
| notcategory={{{exclude category 7|{{{ | | notcategory={{{exclude category 7|{{{12|}}}}}} | ||
| notcategory={{{exclude category 8|{{{ | | notcategory={{{exclude category 8|{{{13|}}}}}} | ||
| notcategory={{{exclude category 9|{{{ | | notcategory={{{exclude category 9|{{{14|}}}}}} | ||
}}</includeonly><noinclude> | }}</includeonly><noinclude> | ||
Line 33: | Line 33: | ||
| exclude category=excluded-category 0 | | exclude category=excluded-category 0 | ||
| exclude category <digit>=excluded-category 1-9 | | exclude category <digit>=excluded-category 1-9 | ||
| notopcategory=1 | |||
}} | }} | ||
Line 42: | Line 43: | ||
| some-namespace-other-than-main | | some-namespace-other-than-main | ||
| number-of-columns | | number-of-columns | ||
| notopcategory | |||
| excluded-category 0 | | excluded-category 0 | ||
| excluded-category 1 | | excluded-category 1 | ||
Line 67: | Line 69: | ||
; category: the category whose member pages should be listed | ; category: the category whose member pages should be listed | ||
; heading: the (level two) heading to go above the table. Leave a blank value for a list with no heading. | ; heading: the (level two) heading to go above the table. Leave a blank value for a list with no heading. Include extra equals signs in the parameter text to get lower-level headings! | ||
; namespace: the namespace listed pages should belong to. The default is Main. | ; namespace: the namespace listed pages should belong to. The default is Main. | ||
; columns: the number of columns in the output table. The default is 2. | ; columns: the number of columns in the output table. The default is 2. | ||
; notopcategory: pages which only belong to the top category are excluded if this parameter has a walue other than the empty string. | |||
; exclude category [''digit'']: name categories which should be excluded from the list. | ; exclude category [''digit'']: name categories which should be excluded from the list. | ||
Due to a limitation in DPL category exclusion doesn't allow the use of pipes <code> | </code> to list more than one category in one parameter value. Instead several calls to the same parameter are necessary. To allow for some flexibility I've made it possible to use up to ten category exclusions with this template, which should be more than enough. <code>excluded category <digit></code> means that you may use named parameters <code>excluded category 1, excluded category 2, excluded category 3</code> and so on up to <code>excluded category 9</code>, or up to ten unnamed parameters with names of categories to exclude as values after the '' | Due to a limitation in DPL category exclusion doesn't allow the use of pipes <code> | </code> to list more than one category in one parameter value. Instead several calls to the same parameter are necessary. To allow for some flexibility I've made it possible to use up to ten category exclusions with this template, which should be more than enough. <code>excluded category <digit></code> means that you may use named parameters <code>excluded category 1, excluded category 2, excluded category 3</code> and so on up to <code>excluded category 9</code>, or up to ten unnamed parameters with names of categories to exclude as values after the ''notopcategory'' parameter. | ||
== What this template does == | == What this template does == | ||
This template calls the Dynamic Page List extension to generate a list of the pages in a given category and its subcategories, listed under headings according to subcategories and crosscategories | This template calls the Dynamic Page List extension to generate a list of the pages in a given category and its subcategories, listed under headings according to subcategories and crosscategories. | ||
To get your page on such a list include it into the relevant category ''or'' one of its subcategories. Practically it means putting the text <code><nowiki>[[Category:category-name]]</nowiki></code> (where <code><nowiki>category-name</nowiki></code> should be replaced by the name of any of the relevant category or one of its subcategories, which you will find listed if you type "Category:category-name" in the wiki search box and hit enter. Traditionally such ''category tags'' go in a group at the bottom or top of the page, so that they can easily be found and edited, but nothing will be broken if you (accidentally) put them somewhere else or add something before or after them. There is no need to include your page both in the top category and one or more of its subcategories, and it will be listed here only once even if you do (and there may be a good reason to do so: your page may be a legitimate member of e.g. all of [[:Category:Conlangs]], [[:Category:Conlangs by {{CURRENTUSER}}]] and [[:Category:Indo-European conlangs]]!) | To get your page on such a list include it into the relevant category ''or'' one of its subcategories. Practically it means putting the text <code><nowiki>[[Category:category-name]]</nowiki></code> (where <code><nowiki>category-name</nowiki></code> should be replaced by the name of any of the relevant category or one of its subcategories, which you will find listed if you type "Category:category-name" in the wiki search box and hit enter. Traditionally such ''category tags'' go in a group at the bottom or top of the page, so that they can easily be found and edited, but nothing will be broken if you (accidentally) put them somewhere else or add something before or after them. There is no need to include your page both in the top category and one or more of its subcategories, and it will be listed here only once even if you do (and there may be a good reason to do so: your page may be a legitimate member of e.g. all of [[:Category:Conlangs]], [[:Category:Conlangs by {{CURRENTUSER}}]] and [[:Category:Indo-European conlangs]]!) |
Latest revision as of 07:22, 1 July 2009
Usage
{{DPL from category by category
| category=somecategory
| heading=listheading
| namespace=some-namespace-other-than-main
| columns=number-of-columns
| exclude category=excluded-category 0
| exclude category <digit>=excluded-category 1-9
| notopcategory=1
}}
OR
{{DPL from category by category
| somecategory
| listheading
| some-namespace-other-than-main
| number-of-columns
| notopcategory
| excluded-category 0
| excluded-category 1
| excluded-category <digit>
| excluded-category 9
}}
e.g.
{{DPL from category by category
| category=Conlangs
| heading=Conlangs on FrathWiki listed by subcategories and crosscategories
| namespace=
| exclude category=Meta-pages
| exclude category 1=Theory
| exclude category 2=Concultures
}}
Named parameters can come in any order. Unnamed parameters must be in the order shown; to skip one of them leave a blank between two pipes.
All parameters except category/the first unnamed parameter are optional!
Parameters
- category
- the category whose member pages should be listed
- heading
- the (level two) heading to go above the table. Leave a blank value for a list with no heading. Include extra equals signs in the parameter text to get lower-level headings!
- namespace
- the namespace listed pages should belong to. The default is Main.
- columns
- the number of columns in the output table. The default is 2.
- notopcategory
- pages which only belong to the top category are excluded if this parameter has a walue other than the empty string.
- exclude category [digit]
- name categories which should be excluded from the list.
Due to a limitation in DPL category exclusion doesn't allow the use of pipes |
to list more than one category in one parameter value. Instead several calls to the same parameter are necessary. To allow for some flexibility I've made it possible to use up to ten category exclusions with this template, which should be more than enough. excluded category <digit>
means that you may use named parameters excluded category 1, excluded category 2, excluded category 3
and so on up to excluded category 9
, or up to ten unnamed parameters with names of categories to exclude as values after the notopcategory parameter.
What this template does
This template calls the Dynamic Page List extension to generate a list of the pages in a given category and its subcategories, listed under headings according to subcategories and crosscategories.
To get your page on such a list include it into the relevant category or one of its subcategories. Practically it means putting the text [[Category:category-name]]
(where category-name
should be replaced by the name of any of the relevant category or one of its subcategories, which you will find listed if you type "Category:category-name" in the wiki search box and hit enter. Traditionally such category tags go in a group at the bottom or top of the page, so that they can easily be found and edited, but nothing will be broken if you (accidentally) put them somewhere else or add something before or after them. There is no need to include your page both in the top category and one or more of its subcategories, and it will be listed here only once even if you do (and there may be a good reason to do so: your page may be a legitimate member of e.g. all of Category:Conlangs, Category:Conlangs by 3.149.253.73 and Category:Indo-European conlangs!)
Why a dynamically generated list is preferable
There are several reasons why a dynamically generated list is preferable to a manually generated list:
- You need to edit only in one place, the page you want listed. (Unless you assign it a hitherto non-existing category in which case you will need to add that category as a subcategory of the top category referenced by the dynamic list or one of its existing subcategories, for which see below.)
- You should anyway assign your page to the appropriate category or categories, so that people with a general rather than particular idea of what they are looking for can find it. The dynamic list creates an extra road to your page in one fell swoop!
- If you should change the name of/move the listed page (or ask a sysop to do it for you), or add/remove/change your page's subcategory the dynamic list will be automatically updated.
- The list will be automatically alphabetized. (Unfortunately not ignoring punctuation for the time being!)
Your own subcategory
You can easily create your own category (e.g. Category:Conlangs by 3.149.253.73) just by putting a category tag [[Category:your-category]]
on your page. If you think it should be included in a list created with this template just go to the page Category:your-category (where of course "your-category" should be replaced by the actual name of your category; please don't actually edit Category:your-category!) by clicking on the category link at the bottom of your page, or type "Category:your-category" in the wiki search box and hit enter, then add [[Category:top-category]]
, where of course "top-category" should be replaced by the actual category name referenced by the dynamic list you want your subcategory to go into!) to the text of the category page of the subcategory to be.