Template:List subpages: Difference between revisions
From FrathWiki
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
<includeonly> | <includeonly>{{#dpl: | ||
{{#dpl: | |||
|{{{parameter|{{{1}}}}}}={{{value|{{{2}}}}}} | |{{{parameter|{{{1}}}}}}={{{value|{{{2}}}}}} | ||
|replaceintitle=#^{{{exclude|{{{3}}}}}} | |replaceintitle=#^{{{exclude|{{{3}}}}}}(.+?)$#,\1 | ||
|mode=userformat | |mode=userformat | ||
|listseparators=,\n* [[%PAGE%{{!}}%TITLE%]],, | |listseparators=,\n* [[%PAGE%{{!}}%TITLE%]],, | ||
|notnamespace=Talk | |{{#ifeq: {{{talk}}} | 1 | | {{#ifeq: {{{talk}}} | yes | | notnamespace=Talk }} }} | ||
}}</includeonly><noinclude> | |||
==Usage== | |||
<pre><nowiki> | |||
{{List subpages| | |||
|parameter=titlematch | |||
|value=Main page% | |||
|exclude=Main page/ | |||
}} | }} | ||
or | |||
{{List subpages|titlematch|Main Page%|Main Page/}} | |||
</nowiki></pre> | |||
== Purpose == | |||
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}} | |||
rather than | rather than | ||
Line 40: | Line 34: | ||
</dpl> | </dpl> | ||
when | 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 == | |||
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>. | |||
</noinclude> |
Revision as of 03:25, 22 April 2009
Usage
{{List subpages| |parameter=titlematch |value=Main page% |exclude=Main page/ }} or {{List subpages|titlematch|Main Page%|Main Page/}}
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%,, |notnamespace=Talk }}
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 Talk pages
Talk pages are excluded by default. If you want to include them pass a named parameter talk=1
or talk=yes
.