Template:List subpages: Difference between revisions

From FrathWiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 3: Line 3:
|replaceintitle=#^{{{exclude|{{{3}}}}}}(.+?)$#,\1
|replaceintitle=#^{{{exclude|{{{3}}}}}}(.+?)$#,\1
|mode=userformat
|mode=userformat
|listseparators=,\n* [[%PAGE%{{!}}%TITLE%]],,
|listseparators=,\n* [[%PAGE%{{!}}{{{prefix|{{{5}}}}}}%TITLE%]],,
|{{#ifeq: {{{talk}}} | 1 | | {{#ifeq: {{{talk}}} | yes | | notnamespace=Talk }} }}
|namespace={{{namespace|{{{4}}}}}}
}}</includeonly><noinclude>
}}</includeonly><noinclude>


Line 20: Line 20:
{{List subpages|titlematch|Main Page%|Main Page/}}
{{List subpages|titlematch|Main Page%|Main Page/}}
</nowiki></pre>
</nowiki></pre>
The


== Purpose ==
== Purpose ==
Line 25: Line 27:
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 38:
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 Talk pages ==
== 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> , and a parameter <code>prefix=''namespace'':</code>, since the namespace isn't automatically included in the generated page title.
 
<pre><nowiki>
{{List subpages|
|parameter=titlematch
|value=Main page%
|exclude=Main page/
|namespace=Talk
|prefix=Talk:
}}
 
or
 
{{List subpages|titlematch|Main Page%|Main Page/|Talk|Talk:}}
</nowiki></pre>


Talk pages are excluded by default.  If you want to include them pass a named parameter <code>talk=1</code> or <code>talk=yes</code>.
{{List subpages|titlematch|Main Page%|Main Page/|Talk|Talk:}}


</noinclude>
</noinclude>

Revision as of 04:14, 22 April 2009


Usage

{{List subpages|
|parameter=titlematch
|value=Main page%
|exclude=Main page/
}}

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* {{{5}}}%TITLE%,, |namespace={{{4}}} }}

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 , and a parameter prefix=namespace:, since the namespace isn't automatically included in the generated page title.

{{List subpages|
|parameter=titlematch
|value=Main page%
|exclude=Main page/
|namespace=Talk
|prefix=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 }}