Fix for theming rows in Views2

  1. <?php
  2. // $Id: views-view-fields.tpl.php,v 1.6 2008/09/24 22:48:21 merlinofchaos Exp $
  3. /**
  4.  * @file views-view-fields.tpl.php
  5.  * Default simple view template to all the fields as a row.
  6.  *
  7.  * - $view: The view in use.
  8.  * - $fields: an array of $field objects. Each one contains:
  9.  *   - $field->content: The output of the field.
  10.  *   - $field->raw: The raw data for the field, if it exists. This is NOT output safe.
  11.  *   - $field->class: The safe class id to use.
  12.  *   - $field->handler: The Views field handler object controlling this field. Do not use
  13.  *     var_export to dump this object, as it can't handle the recursion.
  14.  *   - $field->inline: Whether or not the field should be inline.
  15.  *   - $field->inline_html: either div or span based on the above flag.
  16.  *   - $field->separator: an optional separator that may appear before a field.
  17.  * - $row: The raw result object from the query, with all data it fetched.
  18.  *
  19.  * @ingroup views_templates
  20.  */
  21.  foreach ($fields as $id => $field)
  22.  {
  23.    if ($field->handler->content_field['field_name'] == 'field_educationitemimage')
  24.    {
  25.       $image = $field->content;
  26.    }
  27.  
  28.    if ($field->handler->content_field['field_name'] == 'field_educationitemteaser')
  29.    {
  30.       $teaser = $field->content;
  31.    }
  32.  
  33.    if ($field->handler->field_alias == 'node_title')
  34.    {
  35.       $title = $field->content;
  36.    }
  37.  }
  38.  
  39. ?>
  40.  
  41. <div id="viewseducationwrapper">
  42. <div id="edimgstuff">
  43. <div id="educationitemimg"><?php echo $image; ?> </div>
  44. </div>
  45. <div id="edstuff">
  46. <div id="educationitemtitle"><?php echo $title; ?> </div>
  47. <div class="clearboth"></div>
  48. <div id="educationitemsummary"><?php echo $teaser; ?></div>
  49. </div>
  50. </div>

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.