1
<!-- $Id: theme-field-templates.html,v 1.1.2.4 2008/12/08 20:00:35 yched Exp $ -->
2
<p>Field-level theming determines how the values of a given field are
3
displayed. The resulting output ends up in the <span class="code">$content</span>
4
and <span class="code">$<FIELD_NAME>_rendered</span> variables in the node
7
<h3>Template files</h3>
9
<p>In order to customize field themeing:</p>
13
Copy the <span class="code">content-field.tpl.php</span> template file into
14
your theme's root folder (please keep the contents of the
15
<span class="code">cck/theme</span> folder untouched. For the same reason,
16
need to copy the file instead of just moving it).
19
Edit that copy to your liking. See the comments in
20
<span class="code">cck/theme/content/content-field.tpl.php</span> for a list
21
of all variables available in this template.
25
<h3>Template suggestions</h3>
27
<p>In addition, the theme layer will also look for field-specific variants
28
(suggestions), in the following order of precedence:</p>
31
<dt>content-field-<FIELD_NAME>-<CONTENT_TYPE_NAME>.tpl.php</dt>
33
ex: <span class="code">content-field-field_myfield-story.tpl.php</span> -
34
If present, will be used to theme the 'field_myfield' field when displaying
38
<dt>content-field-<CONTENT_TYPE_NAME>.tpl.php</dt>
40
ex: <span class="code">content-field-story.tpl.php</span> - If present,
41
will be used to theme all fields of 'story' nodes.
44
<dt>content-field-<FIELD_NAME>.tpl.php</dt>
46
ex: <span class="code">content-field-field_myfield.tpl.php</span> -
47
If present, will be used to theme all 'field_myfield' field in all the
48
content types it appears in.
51
<dt>content-field.tpl.php</dt>
53
If none of the above is present, the base template will be used.
57
<strong>Important:</strong>
60
Suggestions work only if the theme also has the base template file.
61
If your theme has <span class="code">content-field-*.tpl.php</span> files,
62
it must also have a <span class="code">content-field.tpl.php</span> file.
65
Whenever you add new template files in your theme, you need to
66
rebuild the theme registry, or the theme engine won't see them.<br/>
67
You can do that by :<br/>
68
- visiting the <a href="&base_url&admin/build/modules">Administer modules</a> page<br/>
69
- or using <a href="http://www.drupal.org/project/devel">Devel module</a>'s
74
<p>See the <a href="http://drupal.org/node/223440">Working with template suggestions</a>
75
section of the <a href="http://drupal.org/theme-guide">Theme guide for Drupal 6</a>
76
for more informations about templates and template suggestions.</p>
b'\\ No newline at end of file'