Difference between revisions of "Template:Bloomberg topic/doc"

From blackwiki
Jump to navigation Jump to search
imported>777sms
imported>Zyxw
(update documentation, add TemplateData)
Line 1: Line 1:
 
{{documentation subpage}}
 
{{documentation subpage}}
 +
{{Documentation subpage}}
 +
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
  
== Function ==
+
This template generates an external link to a topic page at ''[[Bloomberg L.P.|Bloomberg News]]'' website.
Link to a Bloomberg topic page.
 
  
 
== Usage ==
 
== Usage ==
Provide the url path (after the first level) as the first parameter, and an optional name as the second parameter. If no name is provided for the second parameter, the template will use the name of the Wikipedia article.
+
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''ID'' }}</code>
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''ID'' | ''NAME'' }}</code>
  
<nowiki>{{Bloomberg topic|Bloomberg topic name|name}}</nowiki>
+
== Instructions ==
 +
Provide the [[URL]] path (after the first level) as the first parameter, and an optional name as the second parameter. If no name is provided for the second parameter, the template will use the name of the Wikipedia article.
  
Example:
+
== Examples ==
<br><nowiki>{{Bloomberg topic|arab-league|Arab League}}</nowiki>
 
<br>Appears as:
 
<br>{{Bloomberg topic|arab-league|Arab League}}
 
  
Example using default name:
+
=== One parameter ===
<br><nowiki>{{Bloomberg topic|arab-league}}</nowiki>
+
URL:
<br>Appears as:
+
: <code><nowiki>http://</nowiki>topics.bloomberg.com/{{hilite|arab-league}}/</code>
<br>{{Bloomberg topic|music/arab-league}}
+
Usage:
 +
: <code>{{((}}{{BASEPAGENAME}} {{!}} arab-league {{))}}</code>
 +
Output:
 +
: {{{{BASEPAGENAME}} | arab-league }}
  
<includeonly>
+
=== Two parameters ===
<!-- ADD CATEGORIES BELOW THIS LINE -->
+
URL:
[[Category:External link templates|{{PAGENAME}}]]
+
: <code><nowiki>http://</nowiki>topics.bloomberg.com/{{hilite|mark-zuckerberg}}/</code>
<!-- ADD INTERWIKIS BELOW THIS LINE -->
+
Usage:
</includeonly>
+
: <code>{{((}}{{BASEPAGENAME}} {{!}} mark-zuckerberg {{!}} Mark Zuckerberg {{))}}</code>
 +
Output:
 +
: {{{{BASEPAGENAME}} | mark-zuckerberg | Mark Zuckerberg }}
 +
 
 +
== Template data ==
 +
{{TemplateDataHeader}}
 +
<templatedata>
 +
{
 +
        "description": "This template generates an external link to a topic page at the Bloomberg News website.",
 +
"params": {
 +
"1": {
 +
"label": "ID",
 +
"description": "ID string used in the URL.",
 +
"type": "string",
 +
"required": true
 +
},
 +
"2": {
 +
"label": "Name",
 +
"description": "Name displayed in the link text. If not specified it defaults to the article's {{PAGENAME}}, without disambiguation.",
 +
"type": "string",
 +
                        "required": false
 +
}
 +
}
 +
}
 +
</templatedata>
 +
 
 +
== See also ==
 +
* {{tl|NYT topic}}
 +
* {{tl|WSJ topic}}
 +
* {{tl|Guardian topic}}
 +
 
 +
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
 +
<!-- Categories below this line, please; interwikis at Wikidata -->
 +
[[Category:External link templates]]
 +
}}</includeonly>

Revision as of 22:27, 5 October 2014

This template generates an external link to a topic page at Bloomberg News website.

Usage

{{Bloomberg topic | ID }}
{{Bloomberg topic | ID | NAME }}

Instructions

Provide the URL path (after the first level) as the first parameter, and an optional name as the second parameter. If no name is provided for the second parameter, the template will use the name of the Wikipedia article.

Examples

One parameter

URL:

http://topics.bloomberg.com/arab-league/

Usage:

{{Bloomberg topic | arab-league }}

Output:

"[[:Template:PAGENAMEBASE]] collected news and commentary". Bloomberg News. URL–wikilink conflict (help)

Two parameters

URL:

http://topics.bloomberg.com/mark-zuckerberg/

Usage:

{{Bloomberg topic | mark-zuckerberg | Mark Zuckerberg }}

Output:

"Mark Zuckerberg collected news and commentary". Bloomberg News.

Template data

This is the TemplateData documentation for this template used by VisualEditor and other tools; see the monthly parameter usage report for this template.

TemplateData for Bloomberg topic

This template generates an external link to a topic page at the Bloomberg News website.

Template parameters

ParameterDescriptionTypeStatus
ID1

ID string used in the URL.

Stringrequired
Name2

Name displayed in the link text. If not specified it defaults to the article's {{PAGENAME}}, without disambiguation.

Stringoptional

See also