I'm trying to get the custom fields value of a category in a blog view. I have try the article item method but on the child item (supposed to be the current category item in the loop) :
JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/fields.php');
then in the loop
<?php foreach ($this->children[$this->category->id] as $id => $child) : ?>
<?php foreach($child->jcfields as $jcfield)
{
$child->jcFields[$jcfield->name] = $jcfield;
}
and then
<?php echo "test:".$child->jcFields['titre-discipline']->label; ?>
but i get nothing, no error, nothing. One the category actually get value in. THe custom show correctly in the category item view but not in this blog view.
Thanks for your help
<?php echo '<pre>',print_r($child,1),'</pre>'; ?>
into your script. It will print out the multidimensional array containing the article data in a hierarchical / human readable format. Once you can see the content of your array it is easier to debug.