<?php /**--- Enable direct access by name to custom fields (Top) ----*/ ?> <?php foreach($item->jcfields as $jcfield) { $item->jcFields[$jcfield->name] = $jcfield; } ?> <?php /**--------- Custom Fields Header (Around line 120) -----------*/ ?> <?php if ($this->params->get('list_show_votes')) : ?> <th id="categorylist_header_dato"> <?php echo JHtml::_('grid.sort', 'LIST_GILDISKOMA', 'gildiskoma', $listDirn, $listOrder); ?> </th> <?php endif; ?> <?php if ($this->params->get('list_show_votes')) : ?> <th id="categorylist_header_type"> <?php echo JHtml::_('grid.sort', 'LIST_SLAG', 'type''slag', $listDirn, $listOrder); ?> </th> <?php endif; ?> <?php /**--- Custom Category List Fields Content (Around line 250) ---*/ ?> <?php if ($this->params->get('list_show_votes', 0) && $this->vote) : ?> <td headers="categorylist_header_date" class="list-date">gildiskoma"> <?php echo $item->jcFields['gildiskoma']->value; ?> </td> <?php endif; ?> <?php if ($this->params->get('list_show_votes', 0) && $this->vote) : ?> <td headers="categorylist_header_type" class="list-type">slag"> <?php echo $item->jcFields['slag']->value; ?> </td> <?php endif; ?> <?php /**--- Enable direct access by name to custom fields (Top) ----*/ ?> <?php foreach($item->jcfields as $jcfield) { $item->jcFields[$jcfield->name] = $jcfield; } ?> <?php /**--------- Custom Fields Header (Around line 120) -----------*/ ?> <?php if ($this->params->get('list_show_votes')) : ?> <th id="categorylist_header_dato"> <?php echo JHtml::_('grid.sort', 'LIST_GILDISKOMA', 'gildiskoma', $listDirn, $listOrder); ?> </th> <?php endif; ?> <?php if ($this->params->get('list_show_votes')) : ?> <th id="categorylist_header_type"> <?php echo JHtml::_('grid.sort', 'LIST_SLAG', 'type', $listDirn, $listOrder); ?> </th> <?php endif; ?> <?php /**--- Custom Category List Fields Content (Around line 250) ---*/ ?> <?php if ($this->params->get('list_show_votes', 0) && $this->vote) : ?> <td headers="categorylist_header_date" class="list-date"> <?php echo $item->jcFields['gildiskoma']->value; ?> </td> <?php endif; ?> <?php if ($this->params->get('list_show_votes', 0) && $this->vote) : ?> <td headers="categorylist_header_type" class="list-type"> <?php echo $item->jcFields['slag']->value; ?> </td> <?php endif; ?> <?php /**--- Enable direct access by name to custom fields (Top) ----*/ ?> <?php foreach($item->jcfields as $jcfield) { $item->jcFields[$jcfield->name] = $jcfield; } ?> <?php /**--------- Custom Fields Header (Around line 120) -----------*/ ?> <?php if ($this->params->get('list_show_votes')) : ?> <th id="categorylist_header_dato"> <?php echo JHtml::_('grid.sort', 'LIST_GILDISKOMA', 'gildiskoma', $listDirn, $listOrder); ?> </th> <?php endif; ?> <?php if ($this->params->get('list_show_votes')) : ?> <th id="categorylist_header_type"> <?php echo JHtml::_('grid.sort', 'LIST_SLAG', 'slag', $listDirn, $listOrder); ?> </th> <?php endif; ?> <?php /**--- Custom Category List Fields Content (Around line 250) ---*/ ?> <?php if ($this->params->get('list_show_votes', 0) && $this->vote) : ?> <td headers="categorylist_header_date" class="list-gildiskoma"> <?php echo $item->jcFields['gildiskoma']->value; ?> </td> <?php endif; ?> <?php if ($this->params->get('list_show_votes', 0) && $this->vote) : ?> <td headers="categorylist_header_type" class="list-slag"> <?php echo $item->jcFields['slag']->value; ?> </td> <?php endif; ?> So in order to add the custom fields to the Joomla Category List, I've made an template override of 'com_content/category/default_articles.php''com_content/category/default_articles.php' to add two columns that I want to use to display Two Custom fields:
- Date field with Title: 'Entry into force' and name 'gildiskoma'
- Text field with Title 'Type' and name 'slag'
My current override of default_articles.php looks like this:
<?php /**--- Enable direct access by name to custom fields (Top) ----*/ ?> <?php foreach($item->jcfields as $jcfield) { $item->jcFields[$jcfield->name] = $jcfield; } ?> <?php /**--------- CUSTOMCustom FIELDSFields HEADERHeader --(Around line 120) -----------*/ ?> <?php if ($this->params->get('list_show_votes')) : ?> <th id="categorylist_header_dato"> <?php echo JHtml::_('grid.sort', 'LIST_DATE''LIST_GILDISKOMA', 'date''gildiskoma', $listDirn, $listOrder); ?> </th> <?php endif; ?> <?php if ($this->params->get('list_show_votes')) : ?> <th id="categorylist_header_type"> <?php echo JHtml::_('grid.sort', 'LIST_TYPE''LIST_SLAG', 'type', $listDirn, $listOrder); ?> </th> <?php endif; ?> <?php /**------- CUSTOMCustom CATEGORYCategory LISTList FIELDSFields CONTENT---Content (Around line 250) ---*/ ?> <?php if ($this->params->get('list_show_votes', 0) && $this->vote) : ?> <td headers="categorylist_header_date" class="list-date"> CUSTOM<?php FIELDecho DATE$item->jcFields['gildiskoma']->value; VALUE?> </td> <?php endif; ?> <?php if ($this->params->get('list_show_votes', 0) && $this->vote) : ?> <td headers="categorylist_header_type" class="list-type"> CUSTOM<?php FIELDecho TYPE$item->jcFields['slag']->value; VALUE?> </td> <?php endif; ?> We don't use the article vote feature, so I've chosen to use the Custom Fields in its place as you might notice from the code above, which gives me two custom columns.
What I need next is too fetch article's Custom Fields values into the list content, where it says CUSTOM FIELD VALUE.
As I have two Custom Fields (A date field and Tekst-field) for every article which I want to display separately in each list column, I guess I have to fetch the Custom Fields values by their ID somehow.
But I haven't been able to make outThe documentation has a working code from any of it andsection explaining how to add individual fields with override. But my php knowledge is very basiccode above doesn't display the custom fields value.
Help onSo I'm not sure what codeI'm missing to useget the fields value to show in the Custom Fields value is appreciated.list?
So in order to add the custom fields to the Joomla Category List, I've made an template override of 'com_content/category/default_articles.php' to add two columns that I want to use to display Two Custom fields
<?php /**-------------- CUSTOM FIELDS HEADER -------------*/ ?> <?php if ($this->params->get('list_show_votes')) : ?> <th id="categorylist_header_dato"> <?php echo JHtml::_('grid.sort', 'LIST_DATE', 'date', $listDirn, $listOrder); ?> </th> <?php endif; ?> <?php if ($this->params->get('list_show_votes')) : ?> <th id="categorylist_header_type"> <?php echo JHtml::_('grid.sort', 'LIST_TYPE', 'type', $listDirn, $listOrder); ?> </th> <?php endif; ?> <?php /**------- CUSTOM CATEGORY LIST FIELDS CONTENT------*/ ?> <?php if ($this->params->get('list_show_votes', 0) && $this->vote) : ?> <td headers="categorylist_header_date" class="list-date"> CUSTOM FIELD DATE VALUE </td> <?php endif; ?> <?php if ($this->params->get('list_show_votes', 0) && $this->vote) : ?> <td headers="categorylist_header_type" class="list-type"> CUSTOM FIELD TYPE VALUE </td> <?php endif; ?> We don't use the article vote feature, so I've chosen to use the Custom Fields in its place as you might notice from the code above, which gives me two custom columns.
What I need next is too fetch article's Custom Fields values into the list content, where it says CUSTOM FIELD VALUE.
As I have two Custom Fields (A date field and Tekst-field) for every article which I want to display separately in each list column, I guess I have to fetch the Custom Fields values by their ID somehow.
But I haven't been able to make out a working code from any of it and my php knowledge is very basic.
Help on what code to use to show the Custom Fields value is appreciated.
So in order to add the custom fields to the Joomla Category List, I've made an template override of 'com_content/category/default_articles.php' to add two columns that I want to use to display Two Custom fields:
- Date field with Title: 'Entry into force' and name 'gildiskoma'
- Text field with Title 'Type' and name 'slag'
My current override of default_articles.php looks like this:
<?php /**--- Enable direct access by name to custom fields (Top) ----*/ ?> <?php foreach($item->jcfields as $jcfield) { $item->jcFields[$jcfield->name] = $jcfield; } ?> <?php /**--------- Custom Fields Header (Around line 120) -----------*/ ?> <?php if ($this->params->get('list_show_votes')) : ?> <th id="categorylist_header_dato"> <?php echo JHtml::_('grid.sort', 'LIST_GILDISKOMA', 'gildiskoma', $listDirn, $listOrder); ?> </th> <?php endif; ?> <?php if ($this->params->get('list_show_votes')) : ?> <th id="categorylist_header_type"> <?php echo JHtml::_('grid.sort', 'LIST_SLAG', 'type', $listDirn, $listOrder); ?> </th> <?php endif; ?> <?php /**--- Custom Category List Fields Content (Around line 250) ---*/ ?> <?php if ($this->params->get('list_show_votes', 0) && $this->vote) : ?> <td headers="categorylist_header_date" class="list-date"> <?php echo $item->jcFields['gildiskoma']->value; ?> </td> <?php endif; ?> <?php if ($this->params->get('list_show_votes', 0) && $this->vote) : ?> <td headers="categorylist_header_type" class="list-type"> <?php echo $item->jcFields['slag']->value; ?> </td> <?php endif; ?> We don't use the article vote feature, so I've chosen to use the Custom Fields in its place as you might notice from the code above, which gives me two custom columns.
The documentation has a section explaining how to add individual fields with override. But my code above doesn't display the custom fields value.
So I'm not sure what I'm missing to get the fields value to show in the list?
With Joomla 3.7.x article custom fields have finally gotten part of Joomla content.
However, I would like to ask how I can render these Custom Fields in the Joomla Category List?
Adding custom fields to the Joomla Category List is still not part of Joomla (hopefully it will come one day too).
So in order to add the custom fields to the Joomla Category List, I've made an template override of 'com_content/category/default_articles.php' to add two columns that I want to use to display Two Custom fields
<?php /**-------------- CUSTOM FIELDS HEADER -------------*/ ?> <?php if ($this->params->get('list_show_votes')) : ?> <th id="categorylist_header_dato"> <?php echo JHtml::_('grid.sort', 'LIST_DATE', 'date', $listDirn, $listOrder); ?> </th> <?php endif; ?> <?php if ($this->params->get('list_show_votes')) : ?> <th id="categorylist_header_type"> <?php echo JHtml::_('grid.sort', 'LIST_TYPE', 'type', $listDirn, $listOrder); ?> </th> <?php endif; ?> <?php /**------- CUSTOM CATEGORY LIST FIELDS CONTENT------*/ ?> <?php if ($this->params->get('list_show_votes', 0) && $this->vote) : ?> <td headers="categorylist_header_date" class="list-date"> CUSTOM FIELD DATE VALUE </td> <?php endif; ?> <?php if ($this->params->get('list_show_votes', 0) && $this->vote) : ?> <td headers="categorylist_header_type" class="list-type"> CUSTOM FIELD TYPE VALUE </td> <?php endif; ?> We don't use the article vote feature, so I've chosen to use the Custom Fields in its place as you might notice from the code above, which gives me two custom columns.
What I need next is too fetch article's Custom Fields values into the list content, where it says CUSTOM FIELD VALUE.
As I have two Custom Fields (A date field and Tekst-field) for every article which I want to display separately in each list column, I guess I have to fetch the Custom Fields values by their ID somehow.
II've looked at the documentation for J3.x:Adding custom fields/Overrides and also found this post on How to fetch Joomla article custom fields in another component?
But I haven't been able to make out a working code from any of it and my php knowledge is very basic.
Help on what code to use to show the Custom Fields value is appreciated.
Below also a screenshot which illustrates what I'm trying to do. 
With Joomla 3.7.x article custom fields have finally gotten part of Joomla content.
However, I would like to ask how I can render these Custom Fields in the Joomla Category List?
Adding custom fields to the Joomla Category List is still not part of Joomla (hopefully it will come one day too).
So in order to add the custom fields to the Joomla Category List, I've made an template override of 'com_content/category/default_articles.php' to add two columns that I want to use to display Two Custom fields
<?php /**-------------- CUSTOM FIELDS HEADER -------------*/ ?> <?php if ($this->params->get('list_show_votes')) : ?> <th id="categorylist_header_dato"> <?php echo JHtml::_('grid.sort', 'LIST_DATE', 'date', $listDirn, $listOrder); ?> </th> <?php endif; ?> <?php if ($this->params->get('list_show_votes')) : ?> <th id="categorylist_header_type"> <?php echo JHtml::_('grid.sort', 'LIST_TYPE', 'type', $listDirn, $listOrder); ?> </th> <?php endif; ?> <?php /**------- CUSTOM CATEGORY LIST FIELDS CONTENT------*/ ?> <?php if ($this->params->get('list_show_votes', 0) && $this->vote) : ?> <td headers="categorylist_header_date" class="list-date"> CUSTOM FIELD DATE VALUE </td> <?php endif; ?> <?php if ($this->params->get('list_show_votes', 0) && $this->vote) : ?> <td headers="categorylist_header_type" class="list-type"> CUSTOM FIELD TYPE VALUE </td> <?php endif; ?> We don't use the article vote feature, so I've chosen to use the Custom Fields in its place as you might notice from the code above, which gives me two custom columns.
What I need next is too fetch article's Custom Fields values into the list content, where it says CUSTOM FIELD VALUE.
As I have two Custom Fields (A date field and Tekst-field) for every article which I want to display separately in each list column, I guess I have to fetch the Custom Fields values by their ID somehow.
I found this post on How to fetch Joomla article custom fields in another component?
But I haven't been able to make out a working code from it and my php knowledge is very basic.
Help on what code to use to show the Custom Fields value is appreciated.
Below also a screenshot which illustrates what I'm trying to do. 
With Joomla 3.7.x article custom fields have finally gotten part of Joomla content.
However, I would like to ask how I can render these Custom Fields in the Joomla Category List?
Adding custom fields to the Joomla Category List is still not part of Joomla (hopefully it will come one day too).
So in order to add the custom fields to the Joomla Category List, I've made an template override of 'com_content/category/default_articles.php' to add two columns that I want to use to display Two Custom fields
<?php /**-------------- CUSTOM FIELDS HEADER -------------*/ ?> <?php if ($this->params->get('list_show_votes')) : ?> <th id="categorylist_header_dato"> <?php echo JHtml::_('grid.sort', 'LIST_DATE', 'date', $listDirn, $listOrder); ?> </th> <?php endif; ?> <?php if ($this->params->get('list_show_votes')) : ?> <th id="categorylist_header_type"> <?php echo JHtml::_('grid.sort', 'LIST_TYPE', 'type', $listDirn, $listOrder); ?> </th> <?php endif; ?> <?php /**------- CUSTOM CATEGORY LIST FIELDS CONTENT------*/ ?> <?php if ($this->params->get('list_show_votes', 0) && $this->vote) : ?> <td headers="categorylist_header_date" class="list-date"> CUSTOM FIELD DATE VALUE </td> <?php endif; ?> <?php if ($this->params->get('list_show_votes', 0) && $this->vote) : ?> <td headers="categorylist_header_type" class="list-type"> CUSTOM FIELD TYPE VALUE </td> <?php endif; ?> We don't use the article vote feature, so I've chosen to use the Custom Fields in its place as you might notice from the code above, which gives me two custom columns.
What I need next is too fetch article's Custom Fields values into the list content, where it says CUSTOM FIELD VALUE.
As I have two Custom Fields (A date field and Tekst-field) for every article which I want to display separately in each list column, I guess I have to fetch the Custom Fields values by their ID somehow.
I've looked at the documentation for J3.x:Adding custom fields/Overrides and also found this post on How to fetch Joomla article custom fields in another component?
But I haven't been able to make out a working code from any of it and my php knowledge is very basic.
Help on what code to use to show the Custom Fields value is appreciated.
Below also a screenshot which illustrates what I'm trying to do. 