Template:List subpages: Difference between revisions
No edit summary |
No edit summary |
||
(5 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
|replaceintitle=#^{{{exclude|{{{3}}}}}}(.+?)$#,\1 | |replaceintitle=#^{{{exclude|{{{3}}}}}}(.+?)$#,\1 | ||
|mode=userformat | |mode=userformat | ||
|listseparators=,\n* [[%PAGE%{{!}} | |listseparators=,\n* [[%PAGE%{{!}}{{#if: {{{namespace|{{{4|}}}}}} | {{{namespace|{{{4|}}}}}}:}}%TITLE%]],, | ||
|namespace={{{namespace|{{{4|}}}}}} | |||
}}</includeonly><noinclude> | }}</includeonly><noinclude> | ||
Line 14: | Line 14: | ||
|value=Main page% | |value=Main page% | ||
|exclude=Main page/ | |exclude=Main page/ | ||
|namespace= | |||
}} | }} | ||
Line 20: | Line 21: | ||
{{List subpages|titlematch|Main Page%|Main Page/}} | {{List subpages|titlematch|Main Page%|Main Page/}} | ||
</nowiki></pre> | </nowiki></pre> | ||
The | |||
== Purpose == | == Purpose == | ||
Line 25: | Line 28: | ||
The purpose of this template is to can the DPL statements necessary to get a list like | The purpose of this template is to can the DPL statements necessary to get a list like | ||
{{list subpages|titlematch|Main Page%|Main Page}} | {{list subpages|titlematch|Main Page%|Main Page/}} | ||
rather than | rather than | ||
Line 36: | Line 39: | ||
when a DPL search criterion returns a list of subpages, so it makes sense only when you know that the page(s) returned by the search criterion is a list of subpages. | when a DPL search criterion returns a list of subpages, so it makes sense only when you know that the page(s) returned by the search criterion is a list of subpages. | ||
== List | == List another namespace == | ||
By default only pages from the main namespace are included. If you want to list pages from another namespace pass a named parameter <code>namespace=''namespace''</code>. | |||
<pre><nowiki> | |||
{{List subpages| | |||
|parameter=titlematch | |||
|value=Main page% | |||
|exclude=Main page/ | |||
|namespace=Talk | |||
}} | |||
or | |||
{{List subpages|titlematch|Main Page%|Main Page/|Talk|Talk:}} | |||
</nowiki></pre> | |||
Talk | {{List subpages|titlematch|Main Page%|Main Page/|Talk|Talk:}} | ||
</noinclude> | </noinclude> |
Latest revision as of 05:52, 2 July 2009
Usage
{{List subpages| |parameter=titlematch |value=Main page% |exclude=Main page/ |namespace= }} or {{List subpages|titlematch|Main Page%|Main Page/}}
The
Purpose
The purpose of this template is to can the DPL statements necessary to get a list like
{{#dpl: |titlematch=Main Page% |replaceintitle=#^Main Page/(.+?)$#,\1 |mode=userformat |listseparators=,\n* %TITLE%,, |namespace= }}
rather than
<dpl> titlematch=Main Page% notnamespace=Talk </dpl>
when a DPL search criterion returns a list of subpages, so it makes sense only when you know that the page(s) returned by the search criterion is a list of subpages.
List another namespace
By default only pages from the main namespace are included. If you want to list pages from another namespace pass a named parameter namespace=namespace
.
{{List subpages| |parameter=titlematch |value=Main page% |exclude=Main page/ |namespace=Talk }} or {{List subpages|titlematch|Main Page%|Main Page/|Talk|Talk:}}
{{#dpl: |titlematch=Main Page% |replaceintitle=#^Main Page/(.+?)$#,\1 |mode=userformat |listseparators=,\n* Talk:%TITLE%,, |namespace=Talk }}