1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| <?php if (!empty($this->item->jcfields[111]->value)): ; /* PROS FILMS */ ?>
<?php foreach ($this->item->jcfields as $field) {
if ('films-pros' === $field->name && 'subform' === $field->type) {
foreach ($field->subform_rows as $subform_row) {
foreach ($subform_row as $subField) {
if ('film-pros' === $subField->fieldname) {
$field_value = json_decode($this->item->jcfields[111]->rawvalue);
$article_id = $field_value->row0->field110;
$app = Factory::getApplication();
$factory = $app->bootComponent('com_content')->getMVCFactory();
$table = $factory->createTable('Article', 'Table');
$table->load($article_id);
$item_catid = $table->catid;
echo "article_id:" .$article_id ." item_catid:" .$item_catid;
$menuTitle = $subField->value;
$itemid = $subField->rawvalue;
echo HTMLHelper::link(
Route::_('index.php?Itemid=' . $itemid),
$menuTitle
);
}
}
}
}
}
?>
<?php endif; ?> |