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>
<span style="color:{{{color|#7F00FF}}}; {{#if: {{{background|}}} | background:{{{background}}}; }}">{{#ifeq: {{{style}}} | oclc | &#32;&Dagger; | {{pipe}} }}{{{1}}}{{#ifeq: {{{style}}} | oclc | &#32; }}</span><noinclude>
==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.
 
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 traling 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 p. :{{subfield|b}}col. ill. ;{{subfield|c}}24 cm.}}</nowiki> gives:
 
{{example|text=300  32 p. :{{subfield|b}}col. ill. ;{{subfield|c}}24 cm.}}
</noinclude>

Revision as of 20:12, 28 November 2008

|{{{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.

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 traling 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 p. :{{subfield|b}}col. ill. ;{{subfield|c}}24 cm.}} gives:

300  32 p. :|bcol. ill. ;|c24 cm.