Now all modules are in core modules folder
46
modules/cck/help/add-existing-field.html
Normal file
|
@ -0,0 +1,46 @@
|
|||
<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>
|
BIN
modules/cck/help/add-existing-field.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
57
modules/cck/help/add-new-field.html
Normal file
|
@ -0,0 +1,57 @@
|
|||
<p>At the bottom of the <strong>Manage fields</strong> page for a content type,
|
||||
you'll find this:</p>
|
||||
|
||||
<img src="&path&add-new-field.png">
|
||||
|
||||
<p>In order to add a new field to a content type, you need to provide the
|
||||
following information:</p>
|
||||
<dl>
|
||||
<dt>Label:</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.
|
||||
</dd>
|
||||
|
||||
<dt>Field name:</dt>
|
||||
<dd>
|
||||
A machine-readable name for the field. It is used internally to identify
|
||||
the field and handle database storage. When doing custom theming, it is
|
||||
this identifier that you'll use to refer to that field.<br/>
|
||||
<strong>Important:</strong> The field name cannot be changed once the field has been
|
||||
created.<br/>
|
||||
Allowed characters: a-z (unaccentuated), 0-9 and the underscore (_).<br/>
|
||||
The length of the field name cannot exceed 32 characters (including the
|
||||
'field_' prefix that gets added automatically - that is, 26 free characters)<br/>
|
||||
</dd>
|
||||
|
||||
<dt>Field type:</dt>
|
||||
<dd>
|
||||
The type of data to be stored in that field.<br/>
|
||||
<strong>Important:</strong> The field type cannot be changed once the field has been
|
||||
created.<br/>
|
||||
The available field types depend on the modules you have enabled on your site. CCK comes with 6
|
||||
basic field types :
|
||||
<ul>
|
||||
<li>Text</li>
|
||||
<li>Integer</li>
|
||||
<li>Float</li>
|
||||
<li>Decimal</li>
|
||||
<li>Node reference</li>
|
||||
<li>User reference</li>
|
||||
</ul>
|
||||
Additional modules can be downloaded to handle other field types such as
|
||||
dates, files, images... Look at the
|
||||
<a href="http://www.drupal.org/project/cck" target="_blank"> CCK project page</a>
|
||||
and the <a href="http://drupal.org/project/Modules/category/88" target="_blank">complete list of CCK-related modules</a>.
|
||||
</dd>
|
||||
|
||||
<dt>Widget:</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 type, the list of widgets you can select is automatically updated.
|
||||
</dd>
|
||||
</dl>
|
BIN
modules/cck/help/add-new-field.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
39
modules/cck/help/add-new-group.html
Normal file
|
@ -0,0 +1,39 @@
|
|||
<p>Field groups are used to visually gather several fields that are associated
|
||||
by some sort of logic, for instance several text fields that hold the different
|
||||
parts of an 'Address'. On input forms and displayed content, the corresponding
|
||||
fields are enclosed inside an HTML fieldset.</p>
|
||||
|
||||
<img style="vertical-align:top" src="&path&group-node-edit-form.png">
|
||||
<img style="vertical-align:top" src="&path&group-node-display.png">
|
||||
|
||||
<p>At the bottom of the <strong>Manage fields</strong> page for a content type,
|
||||
you'll find this:</p>
|
||||
|
||||
<img src="&path&add-new-group.png">
|
||||
|
||||
<p>In order to add a new group 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 group. 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>Group name:</dt>
|
||||
<dd>
|
||||
A machine-readable name for the group. It is used internally to identify
|
||||
the group. When doing custom theming, it is this identifier that you'll use
|
||||
to refer to that group.<br/>
|
||||
<strong>Important:</strong> The group name cannot be changed once the group has been
|
||||
created.<br/>
|
||||
Allowed characters: a-z (unaccentuated), 0-9 and the underscore (_).<br/>
|
||||
The length of the group name cannot exceed 32 characters (including the
|
||||
'group_' prefix that gets added automatically - that is, 26 free characters)<br/>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<p>Once a group has been created, you can define what fields it will enclose by
|
||||
<a href="topic:content/rearrange">rearranging fields and groups</a>.</p>
|
BIN
modules/cck/help/add-new-group.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
modules/cck/help/add-new.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
15
modules/cck/help/add.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
<p>The form elements at the bottom of the <strong>Manage fields</strong> page
|
||||
let you add fields and groups to your content types.</p>
|
||||
|
||||
<img src="&path&add-new.png">
|
||||
|
||||
<p style="font-size:smaller">(The <strong>Add existing field</strong> row is
|
||||
displayed only if there are fields available in other content types.
|
||||
The <strong>Add new group</strong> rows is displayed only if Fieldgroup module
|
||||
is enabled.)</p>
|
||||
<p>Your fields and groups will be created after you click the <strong>Save</strong>
|
||||
button at the bottom of the page. In subsequent pages you will be presented
|
||||
with the settings form for each field you added.</p>
|
||||
|
||||
<p>You will find more details on the required informations in the
|
||||
following pages:</p>
|
59
modules/cck/help/content.help.ini
Normal file
|
@ -0,0 +1,59 @@
|
|||
|
||||
[advanced help settings]
|
||||
name = CCK
|
||||
index name = "CCK (Content Construction Kit)"
|
||||
|
||||
[fields]
|
||||
title = Fields and Widgets
|
||||
weight = -10
|
||||
|
||||
[manage-fields]
|
||||
title = 'Manage fields' tab
|
||||
|
||||
[add]
|
||||
title = Add fields and groups
|
||||
parent = manage-fields
|
||||
weight = 1
|
||||
|
||||
[add-new-field]
|
||||
title = Add a new field
|
||||
parent = add
|
||||
weight = 1
|
||||
|
||||
[add-existing-field]
|
||||
title = Add an existing field : share a field across content types
|
||||
parent = add
|
||||
weight = 2
|
||||
|
||||
[add-new-group]
|
||||
title = Add a new group
|
||||
parent = add
|
||||
weight = 3
|
||||
|
||||
[rearrange]
|
||||
title = Rearrange fields and groups
|
||||
parent = manage-fields
|
||||
weight = 2
|
||||
|
||||
[remove]
|
||||
title = Remove fields and groups
|
||||
parent = manage-fields
|
||||
weight = 3
|
||||
|
||||
[theme]
|
||||
title = Theming CCK data in nodes
|
||||
|
||||
[theme-node-templates]
|
||||
title = Node templates
|
||||
parent = theme
|
||||
weight = 1
|
||||
|
||||
[theme-field-templates]
|
||||
title = Field templates
|
||||
parent = theme
|
||||
weight = 2
|
||||
|
||||
[theme-formatters]
|
||||
title = Formatter theme functions
|
||||
parent = theme
|
||||
weight = 3
|
BIN
modules/cck/help/drag-groups.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
modules/cck/help/drag-new.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
modules/cck/help/draggable.png
Normal file
After Width: | Height: | Size: 997 B |
1
modules/cck/help/fields.html
Normal file
|
@ -0,0 +1 @@
|
|||
<p>The Content Construction Kit (CCK) is composed of numerous field and widget modules that can be used to add fields to any content type.</p>
|
BIN
modules/cck/help/group-node-display.png
Normal file
After Width: | Height: | Size: 1,022 B |
BIN
modules/cck/help/group-node-edit-form.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
3
modules/cck/help/manage-fields.html
Normal file
|
@ -0,0 +1,3 @@
|
|||
<p>This page lets you manage the CCK fields in your content type : add fields and
|
||||
groups, rearrange them, access their configuration pages, remove them from the
|
||||
content type.</p>
|
24
modules/cck/help/rearrange.html
Normal file
|
@ -0,0 +1,24 @@
|
|||
<p>To change the order of fields, grab a drag-and-drop handle
|
||||
<img src="&path&draggable.png"> and drag the field to a new location in the list
|
||||
(grab a handle by clicking and holding the mouse while hovering over a handle
|
||||
icon). Remember that your changes will not be saved until you click the
|
||||
<strong>Save</strong> button at the bottom of the page.</p>
|
||||
|
||||
<p>The order you define will be used both on input forms (when creating or
|
||||
editing a post), and on content display (teasers, content page, RSS items...)</p>
|
||||
<p>You can also change the order of non-CCK 'fields' like <strong>Title</strong>
|
||||
or <strong>File attachments</strong>. Depending on the 'field', this will
|
||||
affect input forms and/or content display (some of those 'fields' are not
|
||||
displayed in both contexts).</p>
|
||||
<p>If your content type has groups (requires the Fieldgroup module), you can
|
||||
move a field inside a group by dragging it below the row of the group, and
|
||||
then slightly to the right before dropping it. Note that groups can also be
|
||||
reordered, but can currently not be nested inside other groups.</p>
|
||||
|
||||
<img src="&path&drag-groups.png">
|
||||
|
||||
<p>When adding a field or a group, you can drag them directly to the
|
||||
intended spot in the list of fields and groups that are already present in your
|
||||
content type, before clicking <strong>Save</strong>:</p>
|
||||
|
||||
<img src="&path&drag-new.png">
|
16
modules/cck/help/remove.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
<h3>Removing a field</h3>
|
||||
|
||||
<p>When you remove a field from a content type, the data it holds are
|
||||
<strong>permanently</strong> erased. You will be asked to confirm this action</p>
|
||||
|
||||
<p>You will have to manually update your Views, pathauto settings, etc... if
|
||||
needed.</p>
|
||||
|
||||
<p>Note : if the field is shared across several content types, removing it from
|
||||
one content type does <strong>not</strong> affect the data for the other content
|
||||
types.</p>
|
||||
|
||||
<h3>Removing a group</h3>
|
||||
|
||||
<p>Removing a group from a content type does <strong>not</strong> remove the fields
|
||||
it contains, and therefore erases no field data.</p>
|
75
modules/cck/help/theme-field-templates.html
Normal file
|
@ -0,0 +1,75 @@
|
|||
<p>Field-level theming determines how the values of a given field are
|
||||
displayed. The resulting output ends up in the <span class="code">$content</span>
|
||||
and <span class="code">$<FIELD_NAME>_rendered</span> variables in the node
|
||||
templates.</p>
|
||||
|
||||
<h3>Template files</h3>
|
||||
|
||||
<p>In order to customize field themeing:</p>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
Copy the <span class="code">content-field.tpl.php</span> template file into
|
||||
your theme's root folder (please keep the contents of the
|
||||
<span class="code">cck/theme</span> folder untouched. For the same reason,
|
||||
need to copy the file instead of just moving it).
|
||||
</li>
|
||||
<li>
|
||||
Edit that copy to your liking. See the comments in
|
||||
<span class="code">cck/theme/content/content-field.tpl.php</span> for a list
|
||||
of all variables available in this template.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h3>Template suggestions</h3>
|
||||
|
||||
<p>In addition, the theme layer will also look for field-specific variants
|
||||
(suggestions), in the following order of precedence:</p>
|
||||
|
||||
<dl>
|
||||
<dt>content-field-<FIELD_NAME>-<CONTENT_TYPE_NAME>.tpl.php</dt>
|
||||
<dd>
|
||||
ex: <span class="code">content-field-field_myfield-story.tpl.php</span> -
|
||||
If present, will be used to theme the 'field_myfield' field when displaying
|
||||
a 'story' node.
|
||||
</dd>
|
||||
|
||||
<dt>content-field-<CONTENT_TYPE_NAME>.tpl.php</dt>
|
||||
<dd>
|
||||
ex: <span class="code">content-field-story.tpl.php</span> - If present,
|
||||
will be used to theme all fields of 'story' nodes.
|
||||
</dd>
|
||||
|
||||
<dt>content-field-<FIELD_NAME>.tpl.php</dt>
|
||||
<dd>
|
||||
ex: <span class="code">content-field-field_myfield.tpl.php</span> -
|
||||
If present, will be used to theme all 'field_myfield' field in all the
|
||||
content types it appears in.
|
||||
</dd>
|
||||
|
||||
<dt>content-field.tpl.php</dt>
|
||||
<dd>
|
||||
If none of the above is present, the base template will be used.
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<strong>Important:</strong>
|
||||
<ul>
|
||||
<li>
|
||||
Suggestions work only if the theme also has the base template file.
|
||||
If your theme has <span class="code">content-field-*.tpl.php</span> files,
|
||||
it must also have a <span class="code">content-field.tpl.php</span> file.
|
||||
</li>
|
||||
<li>
|
||||
Whenever you add new template files in your theme, you need to
|
||||
rebuild the theme registry, or the theme engine won't see them.<br/>
|
||||
You can do that by :<br/>
|
||||
- visiting the <a href="&base_url&admin/build/modules">Administer modules</a> page<br/>
|
||||
- or using <a href="http://www.drupal.org/project/devel">Devel module</a>'s
|
||||
'clear cache' link.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p>See the <a href="http://drupal.org/node/223440">Working with template suggestions</a>
|
||||
section of the <a href="http://drupal.org/theme-guide">Theme guide for Drupal 6</a>
|
||||
for more informations about templates and template suggestions.</p>
|
13
modules/cck/help/theme-formatters.html
Normal file
|
@ -0,0 +1,13 @@
|
|||
<p>Formatters are used to turn the raw data for a single field value into html.
|
||||
The <strong>Display Fields</strong> tab lets you chose which formatter you want to use
|
||||
for each of your fields.</p>
|
||||
|
||||
<p>In CCK 2.0 for Drupal 6, all formatters now go through the theme layer.
|
||||
Therefore, overriding a formatter's theme is another way you can alter how your
|
||||
values are displayed (whereas changing <span class="code">content-field.tpl.php</span>
|
||||
lets you change the html that "wraps" the values).</p>
|
||||
|
||||
<p>Most formatters come as theme functions, but some might use templates instead.
|
||||
Either way, you can override them using the usual Drupal 6 theme override
|
||||
practices. For more informations, see the <a href="http://drupal.org/theme-guide">Theme guide for Drupal 6</a>,
|
||||
and more specifically the <a href="http://drupal.org/node/173880">Overriding themable output</a> section.</p>
|
130
modules/cck/help/theme-node-templates.html
Normal file
|
@ -0,0 +1,130 @@
|
|||
<h3>Template files</h3>
|
||||
|
||||
<p>All themes usually come with a default <span class="code">node.tpl.php</span>
|
||||
template. Drupal core lets you use the following variant (suggestion):</p>
|
||||
|
||||
<dl>
|
||||
<dt>node-<CONTENT_TYPE_NAME>.tpl.php</dt>
|
||||
<dd>
|
||||
ex: <span class="code">node-story.tpl.php</span> - If present, will be used
|
||||
to theme a 'story' node.
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<p><strong>Important:</strong> whenever you add new template files in your theme, you
|
||||
need to rebuild the theme registry, or the theme engine won't see them.<br/>
|
||||
You can do that by :<br/>
|
||||
- visiting the <a href="&base_url&admin/build/modules">Administer modules</a> page<br/>
|
||||
- or using <a href="http://www.drupal.org/project/devel">Devel module</a>'s
|
||||
'clear cache' link.</p>
|
||||
|
||||
<h3>Template variables</h3>
|
||||
|
||||
<p>CCK makes the following variables available in your theme's node templates:</p>
|
||||
|
||||
<dl>
|
||||
<dt>$<FIELD_NAME>_rendered</dt>
|
||||
<dd>
|
||||
Contains the rendered html for the field, including the label and all the
|
||||
field's values, with the settings defined on the <strong>Display fields</strong> tab.
|
||||
</dd>
|
||||
|
||||
<dt>$<GROUP_NAME>_rendered</dt>
|
||||
<dd>
|
||||
Contains the rendered html for the fieldgroup (if any), including the label
|
||||
and all the group's fields, with the settings defined on the <strong>Display
|
||||
fields</strong> tab.<br/>
|
||||
This variable therefore includes the html contained in all the
|
||||
<span class="code">$<FIELD_NAME>_rendered</span> variables for the
|
||||
group's fields.
|
||||
</dd>
|
||||
|
||||
<dt>$FIELD_NAME</dt>
|
||||
<dd>
|
||||
Contains the raw values of the fields, in the usual array-format used
|
||||
internally by CCK. What you find in there depends on the field type.<br/>
|
||||
Each value also contains a <span class="code">'view'</span> element, that
|
||||
holds the ready-to-display value as rendered by the formatter. For instance:
|
||||
<pre>
|
||||
array(
|
||||
0 => array(
|
||||
'nid' => 5,
|
||||
'view' => '<a href="node/5">Title of node 5</a>',
|
||||
),
|
||||
);</pre>
|
||||
<strong>Raw data are not sanitized for output, it is therefore not
|
||||
advised to use them directly</strong>. Use the <span class="code">'view'</span>
|
||||
value, or run the values through <span class="code">content_format()</span>.
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<h3>Excluding fields from the $content variable</h3>
|
||||
|
||||
<p>By default, the <span class="code">$content</span> variable used in node
|
||||
templates contains the rendered html for the whole node : CCK fields and
|
||||
fieldgroups, but also body, file attachments, fivestar widgets, ...</p>
|
||||
|
||||
<p>If for some fields you want to use the more fine-grained variables described
|
||||
above, you might want to use the <strong>Exclude</strong> checkboxes on the <strong>Display
|
||||
fields</strong> screen, so that the output of those fields is excluded from the
|
||||
<span class="code">$content</span> variable.</p>
|
||||
|
||||
<p>You can then customize the display and layout of some CCK fields or groups
|
||||
using the <span class="code">$<FIELD_NAME>_rendered</span> /
|
||||
<span class="code">$<GROUP_NAME>_rendered</span> variables, and trust
|
||||
<span class="code">$content</span> to display 'the rest' without getting
|
||||
duplicate information.</p>
|
||||
|
||||
<h5>Advanced trick</h5>
|
||||
<p>The <strong>Exclude</strong> checkboxes affect all active themes. On sites with multiple
|
||||
themes, however, the list of fields to exclude from <span class="code">$content</span>
|
||||
might need to be different across the themes, depending on how their respective
|
||||
node templates are structured.</p>
|
||||
|
||||
<p>A theme can bypass those settings by overriding the <span class="code">theme_content_exclude()</span>
|
||||
function to specify the list of fields to exclude for this theme (see the
|
||||
PHPDoc of the function for more information).</p>
|
||||
|
||||
|
||||
<h3>Special case : nodes in nodereference fields</h3>
|
||||
|
||||
<p>In addition to the above, the following suggestions will be looked for
|
||||
in priority for nodes that are displayed as values of a nodereference field using
|
||||
the 'teaser' or 'full node' formatters:</p>
|
||||
|
||||
<dl>
|
||||
<dt>node-nodereference-<REFERRING_FIELD_NAME>-<TYPE_NAME>.tpl.php</dt>
|
||||
<dd>
|
||||
ex: <span class="code">node-nodereference-field_noderef-story.tpl.php</span> -
|
||||
If present, will be used to theme a 'story' node when refererenced in the
|
||||
'field_noderef' field.
|
||||
</dd>
|
||||
|
||||
<dt>node-nodereference-<TYPE_NAME>.tpl.php</dt>
|
||||
<dd>
|
||||
ex: <span class="code">node-nodereference-story.tpl.php</span> - If present,
|
||||
will be used to theme a 'story' node when refererenced in any nodereference
|
||||
field.
|
||||
</dd>
|
||||
|
||||
<dt>node-nodereference-<REFERRING_FIELD_NAME>.tpl.php</dt>
|
||||
<dd>
|
||||
ex: <span class="code">node-nodereference-field_noderef.tpl.php</span> - If
|
||||
present, will be used to a node refererenced in the 'field_noderef' field.
|
||||
</dd>
|
||||
|
||||
<dt>node-nodereference.tpl.php</dt>
|
||||
<dd>
|
||||
If present, will be used to theme nodes referenced in nodereference fields.
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<p>The following additional variables are available in templates for referenced nodes:</p>
|
||||
|
||||
<dl>
|
||||
<dt>$referring_field</dt>
|
||||
<dd>The nodereference field that references the current node.</dd>
|
||||
|
||||
<dt>$referring_node</dt>
|
||||
<dd>The node referencing the current node.</dd>
|
||||
</dl>
|
9
modules/cck/help/theme.html
Normal file
|
@ -0,0 +1,9 @@
|
|||
<p><strong>Note:</strong> these instructions assume you are familiar with the basic concepts
|
||||
of Drupal 6 theming. For more informations, see the <a href="http://drupal.org/theme-guide">Theme guide for Drupal 6</a>,
|
||||
and more specifically the <a href="http://drupal.org/node/173880">Overriding themable output</a>
|
||||
section.</p>
|
||||
|
||||
<p>There are 3 levels where you can customize how the data in CCK fields
|
||||
is displayed in nodes:</p>
|
||||
|
||||
<img src="&path&theme.png" class="content-border">
|
BIN
modules/cck/help/theme.png
Normal file
After Width: | Height: | Size: 4.1 KiB |