Created
January 5, 2020 21:32
-
-
Save AlekVolsk/b560d1115997b02256a10cee57fc56e6 to your computer and use it in GitHub Desktop.
Joomla: get custom fields in a articles module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/fields.php'); | |
foreach ($list as $item) { | |
$item->jcfields = FieldsHelper::getFields('com_content.article', $item, true); | |
$fields = []; | |
foreach($item->jcfields as $jcfield) | |
{ | |
$fields[$jcfield->name] = $jcfield; | |
} | |
// в массиве $fields все поля материала | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment