Minifrontpagepro Layout Override and add fields

That's if you want to show all the folds.

Since I need to display only one field, I adjusted it and came up with the following solution.
<?php    JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/fields.php');
$item->jcfields = FieldsHelper::getFields('com_content.article', $item, true);
foreach((array)$item->jcfields as $jcfield) {
$fields[$jcfield->name] = $jcfield;
}
?>
 
<?php
if (isset($fields['name']->value) && !empty($fields['name']->value)) : ?>
<div class="field-class">
<div class="label-class"><?php echo $fields['name']->label; ?></div>
<?php echo $fields['name']->value; ?></div>
<?php  endif;
?>

Anyway thanks for the help.
2 years 2 weeks ago #7 by dejanbojovic
The topic has been marked as resolved.
  • Posted by TemplatePlazza (5260) Offline
Ah I see. Glad you managed to solve the problem 
2 years 2 weeks ago #8 by TemplatePlazza
The topic has been marked as resolved.
Powered by Kunena Forum