I use custom template and this is how I add field in template file:
<?php if(isset($item->fields_by_key[$params->get('tmpl_params.field_othertitles')])): ?>
<div class="field-othertitles">
<?php echo $item->fields_by_key[$params->get('tmpl_params.field_othertitles')]->result; ?>
</div>
<?php endif; ?>
I have 12 fields added using same type of code.
How can I add label to each field so that it will look at field parameter if label needs to be shown or not and breakable or not.
<?php if($field->params->get('core.show_lable') > 1):?>
<label id="<?php echo $field->id;?>-lbl">
<?php echo $field->label; ?>
</label>
<?php if($field->params->get('core.label_break') > 1):?>
<?php endif;?>
<?php endif;?>
this code is from default tempalte but it does not work because I am using key-s to display fields how I guess. What I need to edit in this code?
I was not able to find info in documentation.
I use custom template and this is how I add field in template file:
I have 12 fields added using same type of code. How can I add label to each field so that it will look at field parameter if label needs to be shown or not and breakable or not.
this code is from default tempalte but it does not work because I am using key-s to display fields how I guess. What I need to edit in this code? I was not able to find info in documentation.