Difference between revisions of "Template:Subfield"
(4 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
<span style="color:{{{color|#7F00FF}}}; {{#if: {{{background|}}} | background:{{{background}}}; }}">{{#ifeq: {{{style}}} | oclc |  ‡ | ‡ }}{{{1}}}{{#ifeq: {{{style}}} | oclc |   }}</span><noinclude> | |||
<span style="color:{{{color|#7F00FF}}}; {{#if {{{background|}}} | background:{{{background}}}; }}">{{#ifeq: {{{style}}} | oclc |  ‡ | | ==Usage== | ||
Automatically formats subfield delimiters and codes. It is especially useful in tables and nested in other templates (such as [[Template:Example]]), where the pipe character has a special value. | |||
The default color is #7F00FF (violet). Note that you cannot specify the background color without also specifying the foreground color. So, to set only the background color without changing the default foreground color, use <code>color=purple|background=</code> and your background color; to set the background color with a plain black foreground, use <code>color=black|background=</code> and your background color. Colors can be specified using either standard CSS color names or using six-character hexadecimal codes. | |||
The default delimiter style is a double dagger and no leading or trailing spaces. The only other defined style is "oclc", which uses a double dagger and has both leading and trailing spaces. | |||
==Examples== | |||
* <nowiki>/{{subfield|c}}by</nowiki> gives: /{{subfield|c}}by | |||
* <nowiki>/{{subfield|color=orange|c}}by</nowiki> gives: /{{subfield|color=orange|c}}by | |||
* <nowiki>/{{subfield|color=purple|background=orange|c}}by</nowiki> gives: /{{subfield|color=purple|background=orange|c}}by | |||
* <nowiki>/{{subfield|style=oclc|c}}by</nowiki> gives: /{{subfield|style=oclc|c}}by | |||
* <nowiki>/{{subfield|color=orange|style=oclc|c}}by</nowiki> gives: /{{subfield|color=orange|style=oclc|c}}by | |||
* <nowiki>/{{subfield|color=purple|background=orange|style=oclc|c}}by</nowiki> gives: /{{subfield|color=purple|background=orange|style=oclc|c}}by | |||
Example in a MARC field: | |||
<nowiki>{{example|text=300 32 pages :{{subfield|b}}color illustrations ;{{subfield|c}}24 cm}}</nowiki> gives: | |||
{{example|text=300 32 pages :{{subfield|b}}color illustrations ;{{subfield|c}}24 cm}} | |||
</noinclude> |
Latest revision as of 21:27, 17 September 2018
‡{{{1}}}
Usage
Automatically formats subfield delimiters and codes. It is especially useful in tables and nested in other templates (such as Template:Example), where the pipe character has a special value.
The default color is #7F00FF (violet). Note that you cannot specify the background color without also specifying the foreground color. So, to set only the background color without changing the default foreground color, use color=purple|background=
and your background color; to set the background color with a plain black foreground, use color=black|background=
and your background color. Colors can be specified using either standard CSS color names or using six-character hexadecimal codes.
The default delimiter style is a double dagger and no leading or trailing spaces. The only other defined style is "oclc", which uses a double dagger and has both leading and trailing spaces.
Examples
- /{{subfield|c}}by gives: /‡cby
- /{{subfield|color=orange|c}}by gives: /‡cby
- /{{subfield|color=purple|background=orange|c}}by gives: /‡cby
- /{{subfield|style=oclc|c}}by gives: / ‡c by
- /{{subfield|color=orange|style=oclc|c}}by gives: / ‡c by
- /{{subfield|color=purple|background=orange|style=oclc|c}}by gives: / ‡c by
Example in a MARC field:
{{example|text=300 32 pages :{{subfield|b}}color illustrations ;{{subfield|c}}24 cm}} gives:
300 32 pages :‡bcolor illustrations ;‡c24 cm