Mr. Johnson (talk | contribs) No edit summary |
Mr. Johnson (talk | contribs) No edit summary |
||
| Line 11: | Line 11: | ||
Adding the second parameter, e.g. {{Code|<nowiki>{{Source|sr5|404}}</nowiki>}}, modifies the return: {{Return|{{Source|sr5|404}}}} | Adding the second parameter, e.g. {{Code|<nowiki>{{Source|sr5|404}}</nowiki>}}, modifies the return: {{Return|{{Source|sr5|404}}}} | ||
Setting {{code|ref}} to any value creates a reference with the first parameter and the value of {{code|ref}} combined into the reference name. If {{code|ref}} is included, the second parameter is ignored | Setting {{code|ref}} to any value creates a reference with the first parameter and the value of {{code|ref}} combined into the reference name. If {{code|ref}} is included, the second parameter is ignored. For instance, {{Code|<nowiki><p>My name is sr5-404{{Source|sr5|ref=404}}.<br />My name is also sr5-404{{Source|sr5|ref=404}}.</p></nowiki>}} returns: | ||
{{Return|My name is sr5-404{{Source|sr5|ref=404}}.<br />My name is also sr5-404{{Source|sr5|ref=404}}.}} | {{Return|My name is sr5-404{{Source|sr5|ref=404}}.<br />My name is also sr5-404{{Source|sr5|ref=404}}.}} | ||
...and... | ...and... | ||
{{Return|<references group="source" />}} | {{Return|<references group="source" />}} | ||
Revision as of 02:37, 26 November 2023
Template:Source is used to create sourcebook references and categorize articles making them. It leverages Template:Source/Text to generate the appropriate strings.
Usage
It accepts one mandatory string parameter, one optional string parameter, and one optional named parameter:
1is a sourcebook abbreviation; valid options are listed inTemplate:Source/Abbreviations.2is a page reference, typically a single integer or a range.ref(defaults unset) is used to turn it into a reference.
Return
{{Source|sr5}} puts the article into the appropriate category, then returns:
Adding the second parameter, e.g. {{Source|sr5|404}}, modifies the return:
Setting ref to any value creates a reference with the first parameter and the value of ref combined into the reference name. If ref is included, the second parameter is ignored. For instance, <p>My name is sr5-404{{Source|sr5|ref=404}}.<br />My name is also sr5-404{{Source|sr5|ref=404}}.</p> returns:
...and...
Cite error: <ref> tags exist for a group named "sr", but no corresponding <references group="sr"/> tag was found
