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>
titlematch=Main Page%
category | namespace | titlematch | linksto | uses | createdby | modifiedby | lastmodifiedby=YOUR CRITERION
replaceintitle=#^Main Page/(.+?)$#,\1
replaceintitle=#^PATTERN-TO-BE-EXCLUDED/(.+?)$#,\1
mode=userformat
mode=userformat
listseparators=,\n* [[%PAGE%|%TITLE%]],,
listseparators=,\n* [[%PAGE%|%TITLE%]],,
Line 9: Line 9:
</includeonly>
</includeonly>
<noinclude>
<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!
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.   
 
'''N.B.''' After the first save DPL will give an errer about invalid parameters.  This is to be expected because you have to replace some
 
Edit the first line after <code><nowiki><dpl></nowiki></code> into a DPL selection criterion which makes sense in your context like <code>titlematch=MainPage%</code> or <code>category=''an existing 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!
 
<pre><nowiki>
<dpl>
category | namespace | titlematch | linksto | uses | createdby | modifiedby | lastmodifiedby=your criterion
replaceintitle=#^Main Page/(.+?)$#,\1 <-- replaceintitle
mode=userformat
listseparators=,\n* [[%PAGE%|%TITLE%]],,
notnamespace=Talk
</dpl>
</nowiki></pre>


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  


<dpl>
<dpl>
titlematch=Main Page%
replaceintitle=#^Main Page/(.+?)$#,\1
replaceintitle=#^Main Page/(.+?)$#,\1
mode=userformat
mode=userformat
listseparators=,\n* [[%PAGE%|%TITLE%]],,
listseparators=,\n* [[%PAGE%|%TITLE%]],,
notnamespace=Talk
</dpl>
</dpl>



Revision as of 02:59, 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.

N.B. After the first save DPL will give an errer about invalid parameters. This is to be expected because you have to replace some

Edit the first line after <dpl> into a DPL selection criterion which makes sense in your context like titlematch=MainPage% or category=an existing 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!

<dpl>
category | namespace | titlematch | linksto | uses | createdby | modifiedby | lastmodifiedby=your criterion
replaceintitle=#^Main Page/(.+?)$#,\1 <-- replaceintitle
mode=userformat
listseparators=,\n* [[%PAGE%|%TITLE%]],,
notnamespace=Talk
</dpl>

The purpose of this template is to can the DPL statements necessary to get a list like

<dpl> replaceintitle=#^Main Page/(.+?)$#,\1 mode=userformat listseparators=,\n* %TITLE%,, </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.