I have an override for the category/blog.php layout and i want to display a headerimage and a subtitle with the custom fields introduced in joomla 3.7. For this implementation I already use Joomla 3.9.3.
I have already used custom fields in articles and it works fine, but not in categories.
To get this to work I limit this to the subtitle. On the screenshot you can see I added a custom field "subtitle" to Category and finally the input field for the subtitle will be placed only in categories (and not in articles).
I tried to display the custom field like the ones in my articles in the other override in category/blog_item.php (-> https://docs.joomla.org/J3.x:Adding_custom_fields/Overrides, Section "Loading individual fields")
<?php // File location: /templates/templatename/html/com_content/category/blog.php // loop first to make the fields easy to reference via the field name as a key foreach($this->item->jcfields as $jcfield): $this->item->customFields[$jcfield->name] = $jcfield; endforeach; echo $this->item->customFields['subtitle']->label; echo $this->item->customFields['subtitle']->name; echo $this->item->customFields['subtitle']->value; echo $this->item->customFields['subtitle']->rawvalue; ?> I also tried it with this code and only the name and the label of the custom field "subtitle" is displayed:
<?php foreach(FieldsHelper::getFields('com_content.categories', $child) as $field) : $child->customFields[$field->name] = $field; endforeach; echo $child->customFields['subtitle']->label; echo $child->customFields['subtitle']->name; echo $child->customFields['subtitle']->value; echo $child->customFields['subtitle']->rawvalue; ?> What am I doing wrong?

$this->itemreally a category object? Does$this->item->jcfieldsactually contains the fields? Is$childa category object?