You are here

add-existing-field.html in Content Construction Kit (CCK) 6.2

Same filename and directory in other branches
  1. 6.3 help/add-existing-field.html

File

help/add-existing-field.html
View source
<p>Using a field across several content type can be handy if a piece of data
is relevant for several content types. A typical use case is a 'Phone number'
field, used in both 'Restaurant' and 'Hotel' content types, even if hotels
and restaurants are different enough to deserve their own specific set of
fields and thus their own dedicated content types.</p>

<p>When a field has been added to more than one content type, we also say it is
"shared", and that it as "several instances".</p>

<p>At the bottom of the <strong>Manage fields</strong> page for a content type,
you'll find this:</p>

<img src="&path&add-existing-field.png">

<p>In order to add a new instance of an existing field to a content type, you
need to provide the following information:</p>
<dl>
  <dt><strong>Label:</strong></dt>
  <dd>
    A human-readable name for the field. It will be used in input forms and
    on displayed content.<br/>
    All characters are allowed, including spaces, accentuated or non-european
    characters.<br/>
  </dd>

  <dt><strong>Field:</strong></dt>
  <dd>
    The field to be shared.<br/>
    A field cannot appear more than once in each content type. Thus, only
    fields that are not already present in the current content type will be
    proposed as "shareable". If none, the <strong>Add existing field</strong>
    option is not available on the <strong>Manage fields</strong> page for
    this content type.<br/>
    Selecting a field automatically populates the <strong>Label</strong> and
    <strong>Widget</strong> values with the ones used by the previous field
    instance, but you can change them if needed before submitting the form.
  </dd>

  <dt><strong>Widget:</strong></dt>
  <dd>
    The form element that will be used to input data for this field on
    content forms : text input, select list, etc...<br/>
    Each field type has its own list of available widgets. When selecting a
    field to share, the list of widgets you can select is automatically updated.
  </dd>
</dl>