Difference between revisions of "Template:Subfield"

From CCS Cataloging Manual
Jump to navigation Jump to search
 
Line 1: Line 1:
<span style="color:{{{color|#7F00FF}}}; {{#if: {{{background|}}} | background:{{{background}}}; }}">{{#ifeq: {{{style}}} | oclc | &#32;&Dagger; | {{pipe}} }}{{{1}}}{{#ifeq: {{{style}}} | oclc | &#32; }}</span><noinclude>
<span style="color:{{{color|#7F00FF}}}; {{#if: {{{background|}}} | background:{{{background}}}; }}">{{#ifeq: {{{style}}} | oclc | &#32;&Dagger; | &Dagger; }}{{{1}}}{{#ifeq: {{{style}}} | oclc | &#32; }}</span><noinclude>
==Usage==
==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.
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.
Line 5: Line 5:
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 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 pipe and no leading or trailing spaces.  The only other defined style is "oclc", which uses a double dagger for the delimiter and has both leading and trailing spaces.
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==
==Examples==
Line 17: Line 17:
Example in a MARC field:
Example in a MARC field:


<nowiki>{{example|text=300  32 p. :{{subfield|b}}col. ill. ;{{subfield|c}}24 cm.}}</nowiki> gives:
<nowiki>{{example|text=300  32 pages :{{subfield|b}}color illustrations ;{{subfield|c}}24 cm}}</nowiki> gives:


{{example|text=300  32 p. :{{subfield|b}}col. ill. ;{{subfield|c}}24 cm.}}
{{example|text=300  32 pages :{{subfield|b}}color illustrations ;{{subfield|c}}24 cm}}
</noinclude>
</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