Difference between revisions of "Template:IBDB show/doc"

From blackwiki
Jump to navigation Jump to search
imported>Zyxw
({{Wikidata property|P1219}})
imported>Zyxw
(update usage and examples for use of Wikidata property, add TemplateData, add categories)
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
<!-- PLEASE ADD CATEGORIES AT THE BOTTOM OF THIS PAGE. -->
+
<!-- Categories go at the bottom of this page and interwikis go in Wikidata. -->
{{Wikidata property|P1219}}
+
{{Uses Wikidata|P1219}}
 +
{{Lua|Module:EditAtWikidata}}
  
==Usage==
+
'''{{NAMESPACE}}:{{BASEPAGENAME}}''' displays an external link to a show's web page at the [[Internet Broadway Database]] (IBDB), operated by the [[The Broadway League]]. It is intended for use in the [[Wikipedia:External links|external links]] section of an article.
<pre>
 
{{IBDB show | id | title}}
 
</pre>
 
  
produces:
+
== Usage ==
:{{IBDB show|id|title}}
+
Unnamed parameters:
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | <var>ID</var> }}</code>
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | <var>ID</var> | <var>TITLE</var> }}</code>
 +
 
 +
Named parameters:
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= <var>ID</var> }}</code>
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= <var>ID</var> | title= <var>TITLE</var> }}</code>
 +
 
 +
Using [[Wikidata]] property [[d:Property:P1219|P1219]]:
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | title= <var>TITLE</var> <nowiki>}}</nowiki></code>
  
 
Where:
 
Where:
:<code>id</code> = show ID number at IBDb
+
: <var>ID</var> = '''show ID''' number at IBDB (which should not be confused with the '''production ID''' which is used in [[Template:IBDB title]])
:<code>title</code> = optional title, otherwise defaults to the page name
+
: <var>TITLE</var> = optional title, otherwise defaults to the page name
 +
 
 +
== Examples ==
 +
 
 +
=== Unnamed parameters ===
 +
''URLs:''
 +
: <kbd><nowiki>https://www.ibdb.com/broadway-show/company-</nowiki>{{Hilite|2719}}</kbd>
 +
: <kbd><nowiki>https://www.ibdb.com/broadway-show/</nowiki>{{Hilite|2719}}</kbd>
 +
: <kbd><nowiki>https://www.ibdb.com/show.php?id=</nowiki>{{Hilite|2719}}</kbd>
 +
 
 +
''Usage:''
 +
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | 2719 | Company: A Musical Comedy <nowiki>}}</nowiki></code>
 +
 
 +
''Output:''
 +
:* {{{{BASEPAGENAME}} | 2719 | Company: A Musical Comedy }}
 +
 
 +
=== Named parameters ===
 +
''URLs:''
 +
: <kbd><nowiki>https://www.ibdb.com/broadway-show/the-tempest-</nowiki>{{Hilite|8555}}</kbd>
 +
: <kbd><nowiki>https://www.ibdb.com/broadway-show/</nowiki>{{Hilite|8555}}</kbd>
 +
: <kbd><nowiki>https://www.ibdb.com/show.php?id=</nowiki>{{Hilite|8555}}</kbd>
 +
 
 +
''Usage:''
 +
: <code><nowiki>* {{</nowiki>{{BASEPAGENAME}} | id= 8555 | title= The Tempest <nowiki>}}</nowiki></code>
 +
 
 +
''Output:''
 +
:* {{{{BASEPAGENAME}} | id= 8555 | title= The Tempest }}
 +
 
 +
=== No ID in template or Wikidata ===
 +
''Usage:''
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
  
;Example
+
''Output:''
<pre>{{IBDB show|id=2719|title=Company: A Musical Comedy}}</pre>
+
: {{ {{BASEPAGENAME}} }}
:produces
 
{{IBDB show|id=2719|title=Company: A Musical Comedy}}
 
  
;Note
+
==TemplateData==
*<code>id</code> ''':''' this template requires the IBDb '''show ID''', which should not be confused with the IBDb '''production ID'''
+
{{TemplateData header}}
 +
<templatedata>
 +
{
 +
        "description": "This template displays an external link to a show's web page at the Internet Broadway Database (IBDB), operated by the The Broadway League. It is intended for use in the external links section of an article.",
 +
        "params": {
 +
                "id": {
 +
                        "aliases" : [ "1" ],
 +
                        "label": "ID",
 +
                        "description": "The \"id\" parameter (or unnamed parameter \"1\") may be used to specify the ID portion of the URL. Example: 2719 is the ID in https://www.ibdb.com/broadway-show/company-2719, https://www.ibdb.com/broadway-show/2719, or https://www.ibdb.com/show.php?id=2719. This parameter is optional if Wikidata property P1219 exists, but required if not.",
 +
                        "type": "number",
 +
"default": "Wikidata property P1219",
 +
                        "required": false
 +
                },
 +
                "title": {
 +
                        "aliases" : [ "2" ],
 +
                        "label": "Title",
 +
                        "description": "The \"title\" parameter (or unnamed parameter \"2\") may be used to specify the show title, which is displayed in italic type in the link text. This parameter is optional; it defaults to the Wikipedia article name, without any disambiguation.",
 +
                        "type": "string",
 +
"default": "{{PAGENAMEBASE}}",
 +
                        "required": false
 +
                }
 +
},
 +
"paramOrder": [
 +
"id",
 +
"title"
 +
]
 +
}
 +
</templatedata>
  
 
==See also==
 
==See also==
*{{tl|IBDB title}} for a specific production of a show
+
* {{tl|IBDB title}} for a specific production of a show
*{{tl|IBDB name}} for the names of individual people
+
* {{tl|IBDB name}} for the names of individual people
*{{tl|IBDB venue}} for named theatres
+
* {{tl|IBDB venue}} for named theatres
  
<includeonly><!--
+
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
++++ PLEASE ADD CATEGORIES BELOW THIS LINE, INSIDE INCLUDEONLY TAGS, THANK YOU. -->
+
<!-- Categories go here and interwikis go in Wikidata. -->
 
[[Category:Theatre external link templates]]
 
[[Category:Theatre external link templates]]
</includeonly>
+
[[Category:External link templates using Wikidata]]
 +
}}</includeonly>

Revision as of 06:49, 1 August 2018

Template:Uses Wikidata

Template:IBDB show displays an external link to a show's web page at the Internet Broadway Database (IBDB), operated by the The Broadway League. It is intended for use in the external links section of an article.

Usage

Unnamed parameters:

{{IBDB show | ID }}
{{IBDB show | ID | TITLE }}

Named parameters:

{{IBDB show | id= ID }}
{{IBDB show | id= ID | title= TITLE }}

Using Wikidata property P1219:

{{IBDB show}}
{{IBDB show | title= TITLE }}

Where:

ID = show ID number at IBDB (which should not be confused with the production ID which is used in Template:IBDB title)
TITLE = optional title, otherwise defaults to the page name

Examples

Unnamed parameters

URLs:

https://www.ibdb.com/broadway-show/company-2719
https://www.ibdb.com/broadway-show/2719
https://www.ibdb.com/show.php?id=2719

Usage:

* {{IBDB show | 2719 | Company: A Musical Comedy }}

Output:

Named parameters

URLs:

https://www.ibdb.com/broadway-show/the-tempest-8555
https://www.ibdb.com/broadway-show/8555
https://www.ibdb.com/show.php?id=8555

Usage:

* {{IBDB show | id= 8555 | title= The Tempest }}

Output:

No ID in template or Wikidata

Usage:

{{IBDB show}}

Output:

Template:PAGENAMEBASE at the Internet Broadway DatabaseScript error: No such module "EditAtWikidata".

TemplateData

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 IBDB show

This template displays an external link to a show's web page at the Internet Broadway Database (IBDB), operated by the The Broadway League. It is intended for use in the external links section of an article.

Template parameters

ParameterDescriptionTypeStatus
IDid 1

The "id" parameter (or unnamed parameter "1") may be used to specify the ID portion of the URL. Example: 2719 is the ID in https://www.ibdb.com/broadway-show/company-2719, https://www.ibdb.com/broadway-show/2719, or https://www.ibdb.com/show.php?id=2719. This parameter is optional if Wikidata property P1219 exists, but required if not.

Default
Wikidata property P1219
Numberoptional
Titletitle 2

The "title" parameter (or unnamed parameter "2") may be used to specify the show title, which is displayed in italic type in the link text. This parameter is optional; it defaults to the Wikipedia article name, without any disambiguation.

Default
{{PAGENAMEBASE}}
Stringoptional

See also