Template:List subpages: Difference between revisions
(New page: <dpl> {{{1}}}={{{2}}} replaceintitle=#([^/]+?)$#,\1|\1 mode=userformat listseparators=,\n* %TITLE%,, </dpl>) |
No edit summary |
||
Line 1: | Line 1: | ||
<includeonly> | |||
<dpl> | <dpl> | ||
titlematch=Main Page% | |||
replaceintitle=# | replaceintitle=#^Main Page/(.+?)$#,\1 | ||
mode=userformat | mode=userformat | ||
listseparators=,\n* [[%TITLE%]],, | listseparators=,\n* [[%PAGE%|%TITLE%]],, | ||
notnamespace=Talk | |||
</dpl> | </dpl> | ||
</includeonly> | |||
<noinclude> | |||
To use this template write <code><nowiki>{{subst:List subpages}}</nowiki></code> where you want the list to go, save the page and edit it again. Replace <code>titlematch=Main Page%</code> by a DPL selection criterion which makes sense in your context like <code>category=''your project's category''</code>, and replace <code>Main Page</code> in the <code>replaceintitle=</code> parameter argument by the part you want excluded in your link text — typically the superpage name. Don't forget that the following slash must be included in the pattern! | |||
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* [[%PAGE%|%TITLE%]],, | |||
notnamespace=Talk | |||
</dpl> | |||
rather than | |||
<dpl> | |||
titlematch=Main Page% | |||
notnamespace=Talk | |||
</dpl> | |||
when the 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.</noinclude> |
Revision as of 02:32, 22 April 2009
To use this template write {{subst:List subpages}}
where you want the list to go, save the page and edit it again. Replace titlematch=Main Page%
by a DPL selection criterion which makes sense in your context like category=your project's category
, and replace Main Page
in the replaceintitle=
parameter argument by the part you want excluded in your link text — typically the superpage name. Don't forget that the following slash must be included in the pattern!
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 </dpl>
rather than
<dpl> titlematch=Main Page% notnamespace=Talk </dpl>
when the 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.