Template:Broader/doc: Difference between revisions

m
19 revisions imported from wikipedia:Template:Broader/doc
(Updated parameter name)
m (19 revisions imported from wikipedia:Template:Broader/doc)
 
(8 intermediate revisions by 3 users not shown)
Line 1:
{{documentationDocumentation subpage}}
{{Lua|Module:Broader}}
 
This template is used to make [[Wikipedia:Summary style|summary style]] explicit. It looks like this:
 
{{broaderBroader|Article}}
 
It is used in sections for which there is also a separate article on the subject. It should be used when there should be a link to another article that discusses a subject more broadly, but is not a main article (which should use {{tl|Main}}), a narrower topic (which should probably use {{tl|Further}}), or at the same level of focus (which should probably use {{tl|See also}}).
 
== Usage ==
 
; Basic usage: {{tlc|Broader|''article''}}
{ With a topic: {broader{tlc|Broader|''article''|topic{{=}}''topic''}}
; With more than one target page: {{tlc|Broader|''article1''|''article2''|''article3''|topic{{=}}''topic''}}
 
{ All parameters: {broader{tlc|Broader|''article''|topic{{=}}''topic''|selfref{{=}}''yes''|category{{=}}''no''}}
; With a topic:
{{broader|''article''|topic=''topic''}}
 
; All parameters:
{{broader|''article''|topic=''topic''|selfref=''yes''|category=''no''}}
 
== Parameters ==
Line 21 ⟶ 19:
This template accepts the following parameters:
* <code>1</code> - the page to link to (required). Categories and files are automatically escaped with the [[Help:Colon trick|colon trick]], and links to sections are automatically formatted as ''page § section'', rather than the MediaWiki default of ''page#section''.
* <code>2</code> (and greater numbers) - any additional pages to link to. These links are also automatically formatted as with the first parameter.
* <code>topic</code> - the name of the topic. If this is not specified, the text "this topic" is used.
* <code>selfref</code> - if set to "yes", "y", "true" or "1", adds the CSS class "selfref". This is used to denote self-references to Wikipedia. See [[Template:Selfref]] for more information.
Line 27 ⟶ 26:
== Examples ==
 
* <code><nowiki>{{broadertlc|Broader|Article}}</nowiki></code> &rarr; {{broaderBroader|Article}}
* <code><nowiki>{{broadertlc|Broader|Article|topic{{=}}some topic}}</nowiki></code> &rarr; {{broaderBroader|Article|topic=some topic}}
 
== Errors ==
 
If no page name is supplied, the template will output the following message:
* {{broaderBroader|category=no}}
 
If you see this error message, it is for one of four reasons:
# No parameters were specified (the template code was <code><nowiki>{{broaderBroader}}</nowiki></code>). Please use <code><nowiki>{{broaderBroader|</nowiki>''page''<nowiki>}}</nowiki></code> instead.
# Some parameters were specified, but the page name wasn't included. For example, the template text <code><nowiki>{{broaderBroader|selfref=yes}}</nowiki></code> will produce this error. Please use (for example) <code><nowiki>{{broaderBroader|</nowiki>''page''<nowiki>|selfref=yes}}</nowiki></code> instead.
# The page name was specified, but it contains an equals sign ("="). The equals sign has a special meaning in template code, and because of this it cannot be used in template parameters that do not specify a parameter name. For example, the template code <code><nowiki>{{broaderBroader|2+2=4}}</nowiki></code> will produce this error. To work around this, you can specify the parameter name explictly by using <code>1=</code> before the page name, (like this: <code><nowiki>{{broaderBroader|1=2+2=4}}</nowiki></code>) or you can disable the equals being interpreted as delimiting a parameter name by [[Template:=|surrounding the equals with double braces]] (like this: <code><nowiki>{{Broader|2+2{{=}}4}}</nowiki></code>).
 
If you see this error message and are unsure of what to do, please post a message on [[WP:HD|the help desk]], and someone should be able to help you.
Line 45 ⟶ 44:
 
== See also ==
*{{tl|Broader2}}, for two broader articles.
*{{tl|Further}}
 
Line 62 ⟶ 60:
},
"2": {
"label": "Article 2",
"description": "The name of an additional article that you want to link to",
"type": "string",
"required": false
},
"3": {
"label": "Article 3",
"description": "The name of an additional article that you want to link to",
"type": "string",
"required": false
},
"4": {
"label": "Article 4",
"description": "The name of an additional article that you want to link to",
"type": "string",
"required": false
},
; With a "topic": {
"label": "Topic",
"description": "A brief description of the topic related to which a broader coverage will be provided. If left blank, the template will read 'For broader coverage related to this topic...'",
Line 81 ⟶ 97:
{{Collapse bottom}}
 
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandboxSandbox other||
<!-- Categories go here and interwikis go in Wikidata. -->
[[Category:Cross-reference templates|{{PAGENAME}}]]
Line 87 ⟶ 103:
[[Category:Exclude in print|{{PAGENAME}}]]
[[Category:Hatnote templates]]
 
}}</includeonly>