Difference between revisions of "Template:Facebook page/doc"

From blackwiki
Jump to navigation Jump to search
imported>Zyxw
m (Since <tt> is obsolete in HTML5, replace it with <kbd> – see HTML element#tt, Wikipedia:HTML5, and mw:Help:Extension:Linter/obsolete-tag. using AWB)
imported>Zyxw
(update to show URLs generated and different output of "id" vs. unnamed parameter 1, add link to tracking category, add categories)
Line 1: Line 1:
 
{{Documentation subpage}}
 
{{Documentation subpage}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE. -->
+
<!-- Place categories where indicated at the bottom of this page and interwikis at Wikidata -->
{{warning|The [[Wikipedia:External links|external links guideline]] recommends [[WP:ELNO|avoiding links to Facebook]] unless the profile is an [[WP:ELOFFICIAL|official account]], "controlled by the subject (organization or individual person) of the Wikipedia article" '''and''' when the links to Facebook "provide the reader with unique content and are not prominently linked from other official websites".  Wikipedia is not a directory for helping Facebook users find pages on Facebook.}}
+
{{Warning|The [[Wikipedia:External links|external links guideline]] recommends [[WP:ELNO|avoiding links to Facebook]] unless the profile is an [[WP:ELOFFICIAL|official account]], "controlled by the subject (organization or individual person) of the Wikipedia article" '''and''' when the links to Facebook "provide the reader with unique content and are not prominently linked from other official websites".  Wikipedia is not a directory for helping Facebook users find pages on Facebook.}}
 +
{{Uses Wikidata|P4003}}
 +
{{Lua|Module:EditAtWikidata}}
 +
{{See also|Template:Facebook|Wikipedia:External links/Perennial websites}}
  
==Usage==
+
'''{{NAMESPACE}}:{{BASEPAGENAME}}''' displays an external link to a page at [[Facebook]], a [[social networking]] website. It is intended for use in the [[Wikipedia:External links|external links]] section of an article.
{{See also|Wikipedia:External links/Perennial websites}}
 
  
The first parameter for the {{tl|Facebook Page}} template is the name and ID of the Facebook account. This can be found in the page's [[Uniform Resource Locator|URL]]. For example: if the URL is <kbd><nowiki>http(s)://www.facebook.com/pages/example/id</nowiki></kbd>, then the account name is ''example'' and ''id'' is the series of numbers after the account name. The second parameter is the description or display name. A third parameter suppresses the wikilink to [[Facebook]] in the words "on [[Facebook]]".
+
== Usage ==
 +
; Named parameters
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''page ID'' }}</code>
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''page ID'' | name= ''Displayed Name'' }}</code>
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | id= ''page ID'' | name= ''Displayed Name'' | link= no }}</code>
 +
 
 +
; Unnamed parameters
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''ID'' }}</code>
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | ''ID'' | ''Displayed Name'' }}</code>
 +
 
 +
; Using [[Wikidata]] property ''{{Property|P4003}}''
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | name= ''Displayed Name'' }}</code>
 +
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} | name= ''Displayed Name'' | link= no }}</code>
 +
 
 +
== Parameters ==
 +
Named parameters, for [[URL]]s such as <kbd>https://<nowiki/>www.facebook.com/'''pages'''/''id''</kbd>
 +
# {{para|id}} is the page ID of the Facebook account.
 +
# {{para|name}} is the description or display name used in the [[link text]].
 +
# {{para|link}} suppresses the wikilink to [[Facebook]] in the words "on [[Facebook]]".
 +
 
 +
Unnamed parameters, for URLs such as <kbd>https://<nowiki/>www.facebook.com/''id''</kbd>
 +
# The first unnamed parameter is the ID of the Facebook account.
 +
# The second unnamed parameter is the description or display name used in the [[link text]].
 +
# Named parameter {{para|link}} may be used here as well
  
 
==Examples==
 
==Examples==
In this example, the Facebook user account is ''wikipedia'' and the id is ''103767749661773'' description in the link is ''Wikipedia'':
+
 
<nowiki>{{Facebook Page|id=wikipedia/103767749661773|name=Wikipedia}}</nowiki>
+
=== Named parameters ===
*:{{Facebook Page|id=wikipedia/103767749661773|name=Wikipedia}}
+
In these examples, the Facebook page ID is ''wikipedia/103767749661773'' and description in the link text is ''Wikipedia'':
 +
 
 +
: <code><nowiki>* {{Facebook | id= wikipedia/103767749661773 | name= Wikipedia }}</nowiki></code>
 +
:* {{{{BASEPAGENAME}} | id= wikipedia/103767749661773 | name= Wikipedia }}
 +
 
 
This example is identical except for the suppress wikilink option:
 
This example is identical except for the suppress wikilink option:
<nowiki>{{Facebook Page|id=wikipedia/103767749661773|name=Wikipedia|link=no}}</nowiki>
+
 
*:{{Facebook Page|id=wikipedia/103767749661773|name=Wikipedia|link=no}}
+
: <code><nowiki>* {{Facebook | id= wikipedia/103767749661773 | name= Wikipedia | link= no }}</nowiki></code>
 +
:* {{{{BASEPAGENAME}} | id= wikipedia/103767749661773 | name= Wikipedia | link= no }}
 +
 
 +
For these examples, the URL generated by the template is:
 +
: <samp>https://<nowiki/>www.facebook.com/'''pages'''/{{Hilite|wikipedia/103767749661773}}</samp>
 +
 
 +
=== Unamed parameters ===
 +
In this example, the Facebook user account is ''wikipedia'' and the description in the link is ''Wikipedia'':
 +
 
 +
: <code><nowiki>* {{Facebook | wikipedia | Wikipedia }}</nowiki></code>
 +
:* {{{{BASEPAGENAME}} | wikipedia | Wikipedia }}
 +
 
 +
For this example, the URL generated by the template is:
 +
: <samp>https://<nowiki/>www.facebook.com/{{Hilite|wikipedia}}</samp>
  
 
===Using Wikidata===
 
===Using Wikidata===
Generally, [[Wikidata]] should contain article subjects' Facebook page IDs in property {{WPL|id=o|P4003}}, allowing the ID parameter to be omitted:
+
Generally, [[Wikidata]] should contain article subjects' Facebook page ID in property {{WPL|id=o|P4003}}, allowing the ID parameter to be omitted:
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}}<nowiki>}}</nowiki></code>
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} |name=''NAME'' }}</code>
 
: <code><nowiki>{{</nowiki>{{BASEPAGENAME}} |name=''NAME'' }}</code>
Line 24: Line 67:
 
: {{ {{BASEPAGENAME}} }}
 
: {{ {{BASEPAGENAME}} }}
  
==See also==
+
== Tracking category ==
*[[Template:Facebook]]
+
* {{clc|Facebook template missing ID}}
*[[Wikipedia:FACEBOOK]]
+
 
*{{tl|Facebook navbox}}
+
== See also ==
 +
* {{tl|Facebook}}, which uses Wikidata property ''{{Property|P2013}}''
 +
* [[Wikipedia:FACEBOOK]]
 +
* {{tl|Facebook navbox}}
  
<includeonly>
+
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS BELOW THIS LINE, THANK YOU. -->
+
<!-- Categories below this line, please; interwikis at Wikidata -->
{{DEFAULTSORT:{{PAGENAME}}}}
+
[[Category:Social media external link templates]]
[[Category:Social media external link templates|Templates for linking to a social networking site]]
+
[[Category:External link templates using Wikidata]]
</includeonly>
+
[[Category:Templates that add a tracking category]]
 +
}}</includeonly>

Revision as of 18:07, 5 August 2018

Template:Uses Wikidata

Template:Facebook page displays an external link to a page at Facebook, a social networking website. It is intended for use in the external links section of an article.

Usage

Named parameters
{{Facebook page | id= page ID }}
{{Facebook page | id= page ID | name= Displayed Name }}
{{Facebook page | id= page ID | name= Displayed Name | link= no }}
Unnamed parameters
{{Facebook page | ID }}
{{Facebook page | ID | Displayed Name }}
Using Wikidata property Template:Property
{{Facebook page}}
{{Facebook page | name= Displayed Name }}
{{Facebook page | name= Displayed Name | link= no }}

Parameters

Named parameters, for URLs such as https://www.facebook.com/pages/id

  1. |id= is the page ID of the Facebook account.
  2. |name= is the description or display name used in the link text.
  3. |link= suppresses the wikilink to Facebook in the words "on Facebook".

Unnamed parameters, for URLs such as https://www.facebook.com/id

  1. The first unnamed parameter is the ID of the Facebook account.
  2. The second unnamed parameter is the description or display name used in the link text.
  3. Named parameter |link= may be used here as well

Examples

Named parameters

In these examples, the Facebook page ID is wikipedia/103767749661773 and description in the link text is Wikipedia:

* {{Facebook | id= wikipedia/103767749661773 | name= Wikipedia }}

This example is identical except for the suppress wikilink option:

* {{Facebook | id= wikipedia/103767749661773 | name= Wikipedia | link= no }}
  • Wikipedia on FacebookScript error: No such module "EditAtWikidata".

For these examples, the URL generated by the template is:

https://www.facebook.com/pages/wikipedia/103767749661773

Unamed parameters

In this example, the Facebook user account is wikipedia and the description in the link is Wikipedia:

* {{Facebook | wikipedia | Wikipedia }}

For this example, the URL generated by the template is:

https://www.facebook.com/wikipedia

Using Wikidata

Generally, Wikidata should contain article subjects' Facebook page ID in property Template:WPL, allowing the ID parameter to be omitted:

{{Facebook page}}
{{Facebook page |name=NAME }}

If the Wikidata property is not defined, the output is:

Template:PAGENAMEBASE on FacebookScript error: No such module "EditAtWikidata".

Tracking category

See also