Joomla // Display fields in modules

// list of the fields by name $ChampsPerso = array( 'logo', 'slogan' ); // list of the fields by id (same order as above) $ChampsPersoID = array( '1', '2' ); $model = JModelLegacy::getInstance('Field', 'FieldsModel', array('ignore_request' => true)); $Fields = $model->getFieldValues($ChampsPersoID, $item->id); // Set the field name for an easier code $Fields = array_combine($ChampsPerso, array_values($Fields)); echo $Fields['logo']; echo $Fields['slogan'];
Snippets to display articles custom fields in module (in my example : mod_articles_category).
You have to decide which fields to load.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.