I started working a project on the upcoming 3.7 version, using the com_fields
.
I have created an article and a category level group of fields. The idea is that I want to use the category level fields to 'globalize' per category those extra values which should be used/displayed as default on each of that category's articles, unless they are overwritten on the article level.
Now on the article view - I have access to the custom fields of the article and I am trying to access also the article's category custom fields, which I did it like so:
JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/fields.php');
$catFields = FieldsHelper::getFields('com_content.categories', $currentCat, true);
The short documentation for the FieldsHelper::getFields
mentions:
- Returns the fields for the given context.
- If the item is an object the returned fields do have an additional field "value" which represents the value for the given item.
But the problem is that I am getting the category's custom fields array containing the fields objects and their properties but without their actual values.
How I could go about this?