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:

Template parameters

Parameter Description Type Status
Namespace parentnamespace

no description

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

no description

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

Creates a 3-column list output

Default
true
Example
true, false
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>
        {{#ifeq: {{{cols|}}}|false|<templatestyles src="Subpages/styles.css" /><div class="template-subpages">|}}<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"
        
        		},
        
        		"parentpage": {
        
        			"label": "Parent page"
        
        		},
        
        		"cols": {
        
        			"label": "Column layout",
        
        			"description": "Creates a 3-column list output",
        
        			"type": "string",
        
        			"example": "true, false",
        
        			"default": "true"
        
        		}
            
            	},
            
            		"bullets": {
            
            			"label": "Bullets",
            
            			"description": "If set to 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 1: Line 1:
 
<includeonly>
 
<includeonly>
{{#ifeq: {{{cols|}}}|false|<templatestyles src="Subpages/styles.css" /><div class="template-subpages">|}}{{Special:Prefixindex|prefix={{{parentnamespace}}}:{{{parentpage}}}/|hideredirects=1|stripprefix=1}}</div></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>
 
<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.
 
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.
Line 23: Line 23:
 
"example": "true, false",
 
"example": "true, false",
 
"default": "true"
 
"default": "true"
 +
},
 +
"bullets": {
 +
"label": "Bullets",
 +
"description": "If set to no, removes bullets from the list",
 +
"example": "yes, no",
 +
"type": "string",
 +
"default": "yes"
 
}
 
}
 
},
 
},

Attachments

Discussions