Difference between revisions of "Template:Instagram/doc"

From blackwiki
Jump to navigation Jump to search
imported>Zyxw
m (fix placement of category to include template, not documentation (via JWB))
imported>Zyxw
(note module used, add intro text, update usage and examples, add TemplateData)
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
<!-- Place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
+
<!-- Place categories where indicated at the bottom of this page and interwikis at Wikidata -->
 
{{Uses Wikidata|P2003}}
 
{{Uses Wikidata|P2003}}
 +
{{Lua|Module:EditAtWikidata}}
  
== Usage ==
+
'''{{NAMESPACE}}:{{BASEPAGENAME}}''' displays an external link to a page at [[Instagram]], a [[photo sharing]] and [[social media]] website. It is intended for use in the [[Wikipedia:External links|external links]] section of an article.
<nowiki>{{Instagram|</nowiki>account_name<nowiki>|</nowiki>account_owner_name<nowiki>}}</nowiki>
+
__TOC__
 +
{{clear}}
  
The first parameter is the account's homepage name, while the second is the title of the account. Example:
+
==Usage==
 +
; Unnamed parameters
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''account_name'' }}</code>
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''account_name'' | ''Displayed Name'' }}</code>
  
<nowiki>{{Instagram|Wikipedia|Wikipedia, the free encyclopedia}}</nowiki>
+
; Named parameters
produces
+
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''account_name'' }}</code>
: {{Instagram|Wikipedia|Wikipedia, the free encyclopedia}}
+
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''account_name'' | name= ''Displayed Name'' }}</code>
  
Hovering over the link shows that the template links to <tt>https://www.instagram.com/Wikipedia/</tt>, whilst the link itself displays "Wikipedia, the free encyclopedia".
+
; Using [[Wikidata]] property {{WPL|id=o|P2003}}
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | name= ''Displayed Name'' }}</code>
 +
 
 +
==Examples==
 +
=== Unnamed parameters ===
 +
''URL:''
 +
: <tt>[https://www.instagram.com/wikipedia/ https://www.instagram.com/{{hilite|wikipedia}}/]</tt>
 +
''Usage:''
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | wikipedia | Wikipedia }}</code>
 +
''Output:''
 +
: {{{{BASEPAGENAME}} | wikipedia | Wikipedia }}
 +
 
 +
=== Named parameters ===
 +
''URL:''
 +
: <tt>[https://www.instagram.com/kevin/ https://www.instagram.com/{{hilite|kevin}}/]</tt>
 +
''Usage:''
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= kevin | name= Kevin Systrom }}</code>
 +
''Output:''
 +
: {{{{BASEPAGENAME}} | id= kevin | name= Kevin Systrom }}
 +
 
 +
=== No parameters and Wikidata property not defined ===
 +
''Usage:''
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
 +
''Output:''
 +
: {{ {{BASEPAGENAME}} }}
 +
 
 +
== TemplateData ==
 +
{{TemplateData header}}
 +
<templatedata>
 +
{
 +
  "description": "This template displays an external link to a page at Instagram, a photo sharing and social media website. It is intended for use in the external links section of an article.",
 +
  "params": {
 +
    "id": {
 +
      "label": "id",
 +
      "aliases": ["1"],  
 +
      "description": "The \"id\" parameter (or unnamed parameter \"1\") should contain the account name in the URL. Example: kevin is the account name in https://www.instagram.com/kevin/. This parameter is optional if Wikidata property P2003 exists, but required if not.",
 +
      "type": "string",
 +
      "required": false,
 +
      "default": "Wikidata property P2003"
 +
    },
 +
    "name": {
 +
      "label": "name",
 +
      "aliases": ["2"],
 +
      "description": "The \"name\" parameter (or unnamed parameter \"2\") may be used to specify the link text. This parameter is optional; it defaults to the Wikipedia article name, without any disambiguation.",
 +
      "type": "string",
 +
      "required": false,
 +
      "default": "{{PAGENAMEBASE}}"
 +
    }
 +
  },
 +
  "paramOrder": [
 +
    "id",
 +
    "name"
 +
  ]
 +
}
 +
</templatedata>
  
 
== Tracking category ==
 
== Tracking category ==

Revision as of 17:05, 3 August 2017

Template:Uses Wikidata

Template:Instagram displays an external link to a page at Instagram, a photo sharing and social media website. It is intended for use in the external links section of an article.

Usage

Unnamed parameters
{{Instagram | account_name }}
{{Instagram | account_name | Displayed Name }}
Named parameters
{{Instagram | id= account_name }}
{{Instagram | id= account_name | name= Displayed Name }}
Using Wikidata property Template:WPL
{{Instagram}}
{{Instagram | name= Displayed Name }}

Examples

Unnamed parameters

URL:

https://www.instagram.com/wikipedia/

Usage:

{{Instagram | wikipedia | Wikipedia }}

Output:

Wikipedia on InstagramScript error: No such module "EditAtWikidata".

Named parameters

URL:

https://www.instagram.com/kevin/

Usage:

{{Instagram | id= kevin | name= Kevin Systrom }}

Output:

Kevin Systrom on InstagramScript error: No such module "EditAtWikidata".

No parameters and Wikidata property not defined

Usage:

{{Instagram}}

Output:

Template:PAGENAMEBASE on InstagramScript 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 Instagram

This template displays an external link to a page at Instagram, a photo sharing and social media website. 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") should contain the account name in the URL. Example: kevin is the account name in https://www.instagram.com/kevin/. This parameter is optional if Wikidata property P2003 exists, but required if not.

Default
Wikidata property P2003
Stringoptional
namename 2

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

Default
{{PAGENAMEBASE}}
Stringoptional

Tracking category

See also