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 months 10 hours ago #7 by dejanbojovic
The topic has been locked.
  • Posted by TemplatePlazza (4849) Offline
Ah I see. Glad you managed to solve the problem 
1 month 4 weeks ago #8 by TemplatePlazza
The topic has been locked.
Powered by Kunena Forum