/[drupal]/contributions/modules/relevant_content/field-relevant-content.tpl.php
ViewVC logotype

Contents of /contributions/modules/relevant_content/field-relevant-content.tpl.php

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download) (as text)
Thu Oct 29 14:31:10 2009 UTC (4 weeks ago) by njt1982
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-7--1
Changes since 1.2: +3 -1 lines
File MIME type: text/x-php
A Final tweak to sort out inline labels with the custom field template.
1 <?php
2 // $Id: field-relevant-content.tpl.php,v 1.2 2009/10/29 14:16:42 njt1982 Exp $
3
4 /**
5 * @file field-relevant-content.tpl.php
6 * Relevant Content specific theme implementation (based around the default field.tpl.php) to display the value of a field.
7 *
8 * Available variables:
9 * - $header: The optional header for the field.
10 * - $items: An array of field values. Use render() to output them.
11 * - $label: The item label.
12 * - $label_hidden: Whether the label display is set to 'hidden'.
13 * - $classes: String of classes that can be used to style contextually through
14 * CSS. It can be manipulated through the variable $classes_array from
15 * preprocess functions. The default values can be one or more of the
16 * following:
17 * - field-name-[field_name]: The current field name. For example, if the
18 * field name is "field_description" it would result in
19 * "field-name-field-description".
20 * - field-type-[field_type]: The current field type. For example, if the
21 * field type is "text" it would result in "field-type-text".
22 * - field-label-[label_display]: The current label position. For example, if the
23 * label position is "above" it would result in "field-label-above".
24 *
25 * Other variables:
26 * - $object: The object to which the field is attached.
27 * - $field: The field array.
28 * - $build_mode: Build mode, e.g. 'full', 'teaser'...
29 * - $field_name: The field name.
30 * - $field_type: The field type.
31 * - $field_name_css: The css-compatible field name.
32 * - $field_type_css: The css-compatible field type.
33 * - $field_language: The field language.
34 * - $field_translatable: Whether the field is translatable or not.
35 * - $label_display: Position of label display, inline, above, or hidden.
36 * - $classes_array: Array of html class attribute values. It is flattened
37 * into a string within the variable $classes.
38 *
39 * @see template_preprocess_field()
40 */
41 ?>
42 <?php if ($items) : ?>
43 <div class="field <?php print $classes; ?> clearfix"<?php print $attributes; ?>>
44 <?php if (!$label_hidden) : ?>
45 <div class="field-label"<?php print $title_attributes; ?>><?php print $label ?>:&nbsp;</div>
46 <?php endif; ?>
47 <div class="field-content">
48 <?php if ($header) : ?>
49 <div class="field-header">
50 <?php print $header ?>
51 </div>
52 <?php endif; ?>
53 <?php print render($items); ?>
54 </div>
55 </div>
56 <?php endif; ?>

  ViewVC Help
Powered by ViewVC 1.1.2