Normally you add image/gallery field to a template position and you get the output of the display variable 'display', but you can also use inside your PHP code:
<?php echo $item->fields['imgfieldname']->display; ?>
Beside the above, here is a list of extra display variable of image / gallery fields
- these following are always available without calling any special PHP code,
just use echo $item->fields['imgfieldname']->...;
Thumbnail URLs of first image only (all thumbnail sizes):
$item->fields['imgfieldname']->{"display_backend_src"}
$item->fields['imgfieldname']->{"display_small_src"}
$item->fields['imgfieldname']->{"display_medium_src"}
$item->fields['imgfieldname']->{"display_large_src"}
$item->fields['imgfieldname']->{"display_original_src"}
Thumbnail URLs of all images (gallery mode) (all thumbnail sizes)
$item->fields['imgfieldname']->thumbs_src['backend'][]
$item->fields['imgfieldname']->thumbs_src['small'][]
$item->fields['imgfieldname']->thumbs_src['medium'][]
$item->fields['imgfieldname']->thumbs_src['large'][]
$item->fields['imgfieldname']->thumbs_src['original'][]
Variables with filesystem PATHs
$field->thumbs_path['backend'][]
$field->thumbs_path['small'][]
$field->thumbs_path['medium'][]
$field->thumbs_path['large'][]
$field->thumbs_path['original'][] [/code]
To create custom display cases use PHP:
FlexicontentFields::getFieldDisplay($this->item, 'fieldname', null, 'display');
FlexicontentFields::getFieldDisplay($this->item, 'fieldname', null, 'display_small');
FlexicontentFields::getFieldDisplay($this->item, 'fieldname', null, 'display_single_total');
See below ...
Display Variables having HTML
$item->fields['imgfieldname']->display
$item->fields['imgfieldname']->display_small
$item->fields['imgfieldname']->display_medium
$item->fields['imgfieldname']->display_large
$item->fields['imgfieldname']->display_original
Special cases:
$item->fields['imgfieldname']->display_single
$item->fields['imgfieldname']->display_single_total
$item->fields['imgfieldname']->display_single_link
$item->fields['imgfieldname']->display_single_total_link