I'm building a Joomla-component (as an example I use com_weblinks) and in the category view I want to have extra fields, e.g. a field for choosing from several layout themes. In default.xml I've added extra fields/fieldset.
<fields name="extrafields">
<fieldset name="extrafields">
<field
name="theme"
When I'm trying to call this param in default_items.php with e.g.
$theme = $this->extrafields->get('theme');
I get an error on frontend 'Call to a member function get() on null'
When I place the extra field under the params fields
<fields name="params">
<fieldset name="basic" label="JGLOBAL_CATEGORY_OPTIONS">
<field
name="theme"
And then calling this param with e.g.
$theme = $this->params->get('theme');
echo $theme;
The name of the chosen theme is correctly displayed.
I can't figure out what I'm doing wrong. Have I missed something? Do I have to put extra code in view.html.php?