views-view-fields--cis-faculty--page.tpl.php

Default simple view template to all the fields as a row.

  • $view: The view in use.
  • $fields: an array of $field objects. Each one contains:
    • $field->content: The output of the field.
    • $field->raw: The raw data for the field, if it exists. This is NOT output safe.
    • $field->class: The safe class id to use.
    • $field->handler: The Views field handler object controlling this field. Do not use var_export to dump this object, as it can't handle the recursion.
    • $field->inline: Whether or not the field should be inline.
    • $field->inline_html: either div or span based on the above flag.
    • $field->wrapper_prefix: A complete wrapper containing the inline_html to use.
    • $field->wrapper_suffix: The closing tag for the wrapper.
    • $field->separator: an optional separator that may appear before a field.
    • $field->label: The wrap label text to use.
    • $field->label_html: The full HTML of the label to use including configured element type.
  • $row: The raw result object from the query, with all data it fetched.

File

profiles/cis/themes/cis-theme/templates/views-view-fields--cis-faculty--page.tpl.php
View source
  1. <?php
  2. /**
  3. * @file
  4. * Default simple view template to all the fields as a row.
  5. *
  6. * - $view: The view in use.
  7. * - $fields: an array of $field objects. Each one contains:
  8. * - $field->content: The output of the field.
  9. * - $field->raw: The raw data for the field, if it exists. This is NOT output safe.
  10. * - $field->class: The safe class id to use.
  11. * - $field->handler: The Views field handler object controlling this field. Do not use
  12. * var_export to dump this object, as it can't handle the recursion.
  13. * - $field->inline: Whether or not the field should be inline.
  14. * - $field->inline_html: either div or span based on the above flag.
  15. * - $field->wrapper_prefix: A complete wrapper containing the inline_html to use.
  16. * - $field->wrapper_suffix: The closing tag for the wrapper.
  17. * - $field->separator: an optional separator that may appear before a field.
  18. * - $field->label: The wrap label text to use.
  19. * - $field->label_html: The full HTML of the label to use including
  20. * configured element type.
  21. * - $row: The raw result object from the query, with all data it fetched.
  22. *
  23. * @ingroup views_templates
  24. */
  25. ?>
  26. <div class="row">
  27. <?php foreach ($fields as $id => $field): ?>
  28. <?php
  29. $cols = 0;
  30. if ($id == 'field_headshot') {
  31. $cols = array(
  32. 'small' => 5,
  33. 'large' => 2,
  34. );
  35. }
  36. else if ($id == 'field_display_name') {
  37. $cols = array(
  38. 'small' => 7,
  39. 'large' => 10,
  40. );
  41. }
  42. ?>
  43. <?php if (is_array($cols)) : ?>
  44. <div class="columns small-<?php print $cols['small']; ?> large-<?php print $cols['large']; ?>">
  45. <?php endif; ?>
  46. <?php if (!empty($field->separator)): ?>
  47. <?php print $field->separator; ?>
  48. <?php endif; ?>
  49. <?php print $field->wrapper_prefix; ?>
  50. <?php print $field->label_html; ?>
  51. <?php
  52. if ($id == 'view_node') {
  53. print str_replace('<a href="', '<a style="color:#' . $row->field_field_color[0]['raw']['jquery_colorpicker'] . '" href="', $field->content);
  54. }
  55. else {
  56. print $field->content;
  57. }?>
  58. <?php print $field->wrapper_suffix; ?>
  59. <?php if ($id == 'view_node' || $id == 'field_headshot') : ?>
  60. </div>
  61. <?php endif; ?>
  62. <?php endforeach; ?>
  63. </div>

Related topics