Hi,
I'm using universal custom template for record list with custom parameters. With custom parameter I'm selecting field in template configuration.
Those fields are only in Type1 but I want be able to select them in every section (types are connected with relation parent-child).
For output I'm using this
<?php
$field_custom = $this->fields_keys_by_id[$params->get('tmpl_params.field_customn')];
if(!empty($item->fields_by_key[$field_custom])):
$custom = $item->fields_by_key[$field_custom];
?>
<?php echo sprintf('<b>%s:</b> %s', $custom->label, $custom->result); ?>
<?php endif; ?>
This works if I select field within same type/section but it does not work if I select field from Type1 in template settings for Section2.
So if I'm in Section2 (Type2) and go to record list template configuration and I select this field from Type1 I get error.
How can I rebuild upper code so it will work for every section?
Regards
Hi,
I'm using universal custom template for record list with custom parameters. With custom parameter I'm selecting field in template configuration.
Those fields are only in Type1 but I want be able to select them in every section (types are connected with relation parent-child).
For output I'm using this
This works if I select field within same type/section but it does not work if I select field from Type1 in template settings for Section2.
So if I'm in Section2 (Type2) and go to record list template configuration and I select this field from Type1 I get error.
How can I rebuild upper code so it will work for every section?
Regards