Difference between revisions of "Template:Subpages"

(Tag: 2017 source edit)
(Tag: 2017 source edit)
 


This template lists all subpages of a wiki page. The result is displayed as a bulleted list and can be set to 1-3 columns.

The template file (Template:Subpages can be downloaded as part of the template package.

screenshot of Subpages template
The subpages template


The following parameters can be set in visual editing mode:

no descriptionno description

Template parameters

Parameter Description Type Status
Namespace parentnamespace

Leave blank for the Main namespace

Default
empty
Example
empty
Auto value
empty
Unknown optional
Parent page parentpage

The page that is one level above the pages you want to display

Default
empty
Example
empty
Auto value
empty
Unknown optional
Column layout cols

Creates a yes: creates 3 -column list outputcolumn layou, no: creates no columns

Default
true
yes
Example
trueyes, falseno
Auto value
empty
String optional
Bullets bullets

If set to no, : removes bullets from the list

Default
yes
Example
yes, no
Auto value
empty
String optional
<includeonly>
        <templatestyles src="Subpages/styles.css" /><div class="{{#ifeq: {{{cols|}}}|no|template-subpages|}} {{#ifeq: {{{bullets|}}}|no|no-bullets|}}">{{Special:Prefixindex|prefix={{{parentnamespace}}}:{{{parentpage}}}/|hideredirects=1|stripprefix=1}}</div></includeonly>
        <noinclude>
        
        This template lists all subpages of a wiki page. The result is displayed as a bulleted list and can be set to 1-3 columns.
        

        The template file (''Template:Subpages'' can be downloaded as part of the [[Manual:Template/Template package|template package]].
        
        [[File:template-download-Subpages.PNG|550x550px|center|alt=screenshot of Subpages template|thumb|The subpages template]]
        
<templatedata>
        
        {
        
        	"params": {
        
        		"parentnamespace": {
        
        			"label": "Namespace"
            ,
            
            			"description": "Leave blank for the Main namespace"
            },
        
        		"parentpage": {
        
        			"label": "Parent page"
            ,
            
            			"description": "The page that is one level above the pages you want to display"
            },
        
        		"cols": {
        
        			"label": "Column layout",
        
        			"description": "Creates ayes: creates 3- column list output",
            
            			"type": "string",
            
            			"example": "true, false",
            
            			"default": "truelayou, no: creates no columns",
            
            			"type": "string",
            
            			"example": "yes, no",
            
            			"default": "yes"
        
        		},
        
        		"bullets": {
        
        			"label": "Bullets",
        
        			"description": "If set to no,no: removes bullets from the list",
        
        			"example": "yes, no",
        
        			"type": "string",
        
        			"default": "yes"
        
        		}
        
        	},
        
        	"description": "The following parameters can be set in visual editing mode:"
        
        }
        </templatedata>
        </noinclude>
(One intermediate revision by the same user not shown)
Line 12: Line 12:
 
"params": {
 
"params": {
 
"parentnamespace": {
 
"parentnamespace": {
"label": "Namespace"
+
"label": "Namespace",
 +
"description": "Leave blank for the Main namespace"
 
},
 
},
 
"parentpage": {
 
"parentpage": {
"label": "Parent page"
+
"label": "Parent page",
 +
"description": "The page that is one level above the pages you want to display"
 
},
 
},
 
"cols": {
 
"cols": {
 
"label": "Column layout",
 
"label": "Column layout",
"description": "Creates a 3-column list output",
+
"description": "yes: creates 3 column layou, no: creates no columns",
 
"type": "string",
 
"type": "string",
"example": "true, false",
+
"example": "yes, no",
"default": "true"
+
"default": "yes"
 
},
 
},
 
"bullets": {
 
"bullets": {
 
"label": "Bullets",
 
"label": "Bullets",
"description": "If set to no, removes bullets from the list",
+
"description": "no: removes bullets from the list",
 
"example": "yes, no",
 
"example": "yes, no",
 
"type": "string",
 
"type": "string",

Attachments

Discussions