views-delimited-list-fields.tpl.php in Views Delimited List 6
Same filename and directory in other branches
File
views-delimited-list-fields.tpl.phpView source
<?php
/**
* @file views-view-fields.tpl.php
* Default simple view template to all the fields as a row. This template overrides
* the original template from Views to output no extra whitespace.
*
* - $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->separator: an optional separator that may appear before a field.
* - $row: The raw result object from the query, with all data it fetched.
*
* In addition, $field in more recent Views 3 has the following extra properties:
*
* - $field->wrapper_prefix: A complete wrapper containing the inline_html to use.
* - $field->wrapper_suffix: The closing tag for the wrapper.
* - $field->label: The wrap label text to use.
* - $field->label_html: The full HTML of the label to use including
* configured element type.
*
* @ingroup views_templates
*/
foreach ($fields as $id => $field) {
// Field separator
if (!empty($field->separator)) {
print $field->separator;
}
// Wrapper
if (!empty($field->wrapper_prefix)) {
// Views 3 recent: wrapper elements
print $field->wrapper_prefix;
}
elseif (!empty($field->inline_html)) {
// Earlier versions: regular fields
print '<' . $field->inline_html . ' class="views-field-' . $field->class . '">';
}
// Label
if (!empty($field->label_html)) {
// Views 3 recent: Preprocessed label markup
print $field->label_html;
}
elseif (!empty($field->label)) {
// Legacy label
print '<label class="views-label-' . $field->class . '">' . $field->label . '</label>';
}
// Content
if (empty($field->element_type)) {
// New field
print $field->content;
}
else {
// Legacy field
print '<' . $field->element_type . ' class="field-content">' . $field->content . '</' . $field->element_type . '>';
}
// Wrapper end
if (!empty($field->wrapper_suffix)) {
// Views 3 recent: erapper elements
print $field->wrapper_suffix;
}
elseif (!empty($field->inline_html)) {
// Earlier versions: regular fields
print '</' . $field->inline_html . '>';
}
}