Have a question about CiviCRM? Get it answered quickly at the new CiviCRM Stack Exchange Q+A siteThis forum was archived on 25 November 2017. Learn more.How to get involved.What to do if you think you've found a bug.
<pre><?php print_r(array_keys(get_defined_vars())); ?></pre>
Array( [0] => template_file [1] => variables [2] => template_files [3] => view [4] => field [5] => row [6] => zebra [7] => id [8] => directory [9] => is_admin [10] => is_front [11] => logged_in [12] => db_is_active [13] => user [14] => output)
print_r($fields['image_1']->content);
Array ( [1] => Array ( [id] => 1 [file_type_id] => [mime_type] => image/png [uri] => g3157_c759aef97cf4fa5a1bc2879959bfd1a5.png [document] => [description] => [upload_date] => 2010-02-23 11:50:12 ) )
$image_ids = array_keys($fields['image_1']->content); $image_uri = url(crm_get_file($image_ids[0]));
$image_uris = array();$image_ids = array_keys($fields['image_1']->content); foreach($image_ids as $image_id) { $image_uris[] = url(crm_get_file($image_id));}
Array ( [2] => Array ( [id] => 2 [file_type_id] => [mime_type] => image/jpeg [uri] => 72_dpi_Bosc_on_Box_edited_1_f3cf598b364fe47ea155995eddd67e49.jpg [document] => [description] => [upload_date] => 2010-03-11 10:01:35 ) )
<?php// $Id: views-view-fields.tpl.php,v 1.6 2008/09/24 22:48:21 merlinofchaos Exp $/** * @file views-view-fields.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->separator: an optional separator that may appear before a field. * - $row: The raw result object from the query, with all data it fetched. * * @ingroup views_templates */?><?php $img_uri = url(get_civicrm_image($fields['image_1']->content, array(300, 200))); ?><?php foreach ($fields as $id => $field): ?> <?php if (!empty($field->separator)): ?> <?php print $field->separator; ?> <?php endif; ?> <<?php print $field->inline_html;?> class="views-field-<?php print $field->class; ?>"> <?php if ($field->label): ?> <label class="views-label-<?php print $field->class; ?>"> <?php print $field->label; ?>: </label> <?php endif; ?> <?php // $field->element_type is either SPAN or DIV depending upon whether or not // the field is a 'block' element type or 'inline' element type. ?> <<?php print $field->element_type; ?> class="field-content"><?php print $field->content; ?></<?php print $field->element_type; ?>> </<?php print $field->inline_html;?>> <?php print_r($fields['image_1']->content); ?><?php endforeach; ?>
<?php $img_uri = url(get_civicrm_image($fields['image_1']->content, array(300, 200))); ?>
<?php print_r($fields['image_1']->content); ?>
$image_ids = array_keys($fields['image_1']->content); $image_uri = url(get_civicrm_image($image_ids[0]));
CRM_Core_Error Object ( [_errors] => Array ( [0] => Array ( [code] => 8000 [params] => Array ( [0] => ) [package] => CiviCRM [level] => Fatal [time] => 1268365444.03 [context] => Array ( [file] => ~/sites/all/modules/civicrm/CRM/Core/Error.php [line] => 417 [function] => createError [class] => CRM_Core_Error ) [message] => Required parameters missing. ) ) [_errorsByLevel] => Array ( [Fatal] => Array ( [0] => Array ( [code] => 8000 [params] => Array ( [0] => ) [package] => CiviCRM [level] => Fatal [time] => 1268365444.03 [context] => Array ( [file] => ~/sites/all/modules/civicrm/CRM/Core/Error.php [line] => 417 [function] => createError [class] => CRM_Core_Error ) [message] => Required parameters missing. ) ) ) [_package] => CiviCRM [_compat] => [_msgCallback] => Array ( [0] => CRM_Core_Error Object *RECURSION* [1] => getErrorMessage ) [_contextCallback] => Array ( [0] => CRM_Core_Error Object *RECURSION* [1] => getFileLine ) [_errorCallback] => Array ( ) [_logger] => Log_display Object ( [_lineFormat] => %3$s: %4$s[_timeFormat] => %b %d %H:%M:%S [_opened] => [_id] => e2928f29db30e1fc7c8c7f024f83b91c [_ident] => [_priority] => 6 [_mask] => 255 [_listeners] => Array ( ) [_formatMap] => Array ( [%{timestamp}] => %1$s [%{ident}] => %2$s [%{priority}] => %3$s [%{message}] => %4$s [%{file}] => %5$s [%{line}] => %6$s [%{function}] => %7$s [%{class}] => %8$s [%\{] => %%{ ) ) [_errorMsgs] => Array ( ) )
$image_ids = array_keys($fields['image_1']->content); print_r($image_ids);
<?php// $Id: views-view-fields.tpl.php,v 1.6 2008/09/24 22:48:21 merlinofchaos Exp $/** * @file views-view-fields.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->separator: an optional separator that may appear before a field. * - $row: The raw result object from the query, with all data it fetched. * * @ingroup views_templates */?><?php $image_ids = array_keys($fields['image_1']->content); $image_uri = url(get_civicrm_image($image_ids[0])); ?><?php foreach ($fields as $id => $field): ?> <?php if (!empty($field->separator)): ?> <?php print $field->separator; ?> <?php endif; ?> <<?php print $field->inline_html;?> class="views-field-<?php print $field->class; ?>"> <?php if ($field->label): ?> <label class="views-label-<?php print $field->class; ?>"> <?php print $field->label; ?>: </label> <?php endif; ?> <?php // $field->element_type is either SPAN or DIV depending upon whether or not // the field is a 'block' element type or 'inline' element type. ?> <<?php print $field->element_type; ?> class="field-content"><?php print $field->content; ?></<?php print $field->element_type; ?>> </<?php print $field->inline_html;?>><?php endforeach; ?>
<?php// $Id: views-view-fields.tpl.php,v 1.6 2008/09/24 22:48:21 merlinofchaos Exp $/** * @file views-view-fields.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->separator: an optional separator that may appear before a field. * - $row: The raw result object from the query, with all data it fetched. * * @ingroup views_templates */?><pre><?php $test = $fields['image_1']->content; print_r($test);print_r($fields['image_1']->raw); ?></pre>