Difference between revisions of "Template:P/Doc"

From ISFDB
Jump to navigation Jump to search
(Copyedit plus add usage forms for no named parameters and using the tag parameter)
(pubtag->pubid)
 
(6 intermediate revisions by one other user not shown)
Line 1: Line 1:
------
+
This template is for linking to an ISFDB publication record.
Documentation for '''[[:Template:P]]''' transcluded from '''[[:Template:P/Doc]]'''.
 
 
 
== Purpose ==
 
This template is for linking to a ISFDB publication record.
 
  
 
== Usage ==
 
== Usage ==
Call this template with a publication's tag or record number and, optionally, the publication's name or any string to display for the link.
+
Call this template with a publication's ID or record number and, optionally, the publication's name or any string to display for the link.
: <code><nowiki> {{P|SHPFRMRSD2000}} </nowiki></code>
+
: <code><nowiki>{{P|38228}}</nowiki></code>
gives this link: {{P|SHPFRMRSD2000}}
+
gives this link: {{P|38228}}
  
 
Optionally, you can change the displayed link text.
 
Optionally, you can change the displayed link text.
: <code><nowiki> {{P|SHPFRMRSD2000|Sheepfarmer's Daughter}} </nowiki></code>
+
: <code><nowiki> {{P|38228|Sheepfarmer's Daughter}} </nowiki></code>
gives this link: {{P|SHPFRMRSD2000|Sheepfarmer's Daughter}}
+
gives this link: {{P|38228|Sheepfarmer's Daughter}}
  
Note that any string can be passed instead of a publication title, for example, <code><nowiki>{{P|SHPFRMRSD2000|this publication}}</nowiki></code> would display as {{P|SHPFRMRSD2000|this publication}}.
+
Note that any string can be passed instead of a publication title, for example, <code><nowiki>{{P|38228|this publication}}</nowiki></code> displays as {{P|38228|this publication}}.
  
The template parameters can also be referenced using the names ''tag'' and ''name'' respectively with the only requirement being that if the named ''tag'' parameter name is used then ''name'' must be used if the second parameter is used. These forms are valid
+
The template parameters can also be referenced using the names ''id'' and ''name'' respectively with the only requirement being that if the named ''id'' parameter name is used then ''name'' must be used if the second parameter is used. These forms are valid
* <code><nowiki>{{P|tag=SHPFRMRSD2000}}</nowiki></code> displays as {{P|tag=SHPFRMRSD2000}}.
+
* <code><nowiki>{{P|id=38228}}</nowiki></code> displays as {{P|id=38228}}.
* <code><nowiki>{{P|tag=SHPFRMRSD2000|name=Sheepfarmer's Daughter}}</nowiki></code> displays as {{P|tag=SHPFRMRSD2000|name=Sheepfarmer's Daughter}}.
+
* <code><nowiki>{{P|id=38228|name=Sheepfarmer's Daughter}}</nowiki></code> displays as {{P|id=38228|name=Sheepfarmer's Daughter}}.
* <code><nowiki>{{P|SHPFRMRSD2000|name=Sheepfarmer's Daughter}}</nowiki></code> displays as {{P|SHPFRMRSD2000|name=Sheepfarmer's Daughter}}.
+
* <code><nowiki>{{P|38228|name=Sheepfarmer's Daughter}}</nowiki></code> displays as {{P|38228|name=Sheepfarmer's Daughter}}.
  
This form is not allowed:
+
This form is not allowed as ''name='' must be used when ''id='' is used:
* <code><nowiki>{{P|tag=SHPFRMRSD2000|Sheepfarmer's Daughter}}</nowiki></code>.
+
* <code><nowiki>{{P|id=38228|Sheepfarmer's Daughter}}</nowiki></code>
 +
 
 +
'''Note''' that while the examples on this page are using publication IDs, using a publication's tag, while deprecated, is still supported. Although very rare, a publication record's tag value can be changed rendering links to that publication invalid while its record number cannot be changed.
 +
 
 +
------
 +
Documentation for '''[[:Template:P]]''' is transcluded from '''[[:Template:P/Doc]]'''.

Latest revision as of 00:31, 14 December 2021

This template is for linking to an ISFDB publication record.

Usage

Call this template with a publication's ID or record number and, optionally, the publication's name or any string to display for the link.

{{P|38228}}

gives this link: 38228

Optionally, you can change the displayed link text.

{{P|38228|Sheepfarmer's Daughter}}

gives this link: Sheepfarmer's Daughter

Note that any string can be passed instead of a publication title, for example, {{P|38228|this publication}} displays as this publication.

The template parameters can also be referenced using the names id and name respectively with the only requirement being that if the named id parameter name is used then name must be used if the second parameter is used. These forms are valid

This form is not allowed as name= must be used when id= is used:

  • {{P|id=38228|Sheepfarmer's Daughter}}

Note that while the examples on this page are using publication IDs, using a publication's tag, while deprecated, is still supported. Although very rare, a publication record's tag value can be changed rendering links to that publication invalid while its record number cannot be changed.


Documentation for Template:P is transcluded from Template:P/Doc.