This is a public ticket. Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.
Monday, 18 November 2019 13:35 EET
We would like Minitek Wall Pro displaying Joomla Article Custom Fields, like it can display K2 extra fields as explained here: https://www.minitek.gr/support/documentation/frequently-asked-questions/joomla-extensions/how-to-display-a-k2-extra-field-in-minitek-modules?highlight=WyJmaWVsZCIsIidmaWVsZCJd

In blog-view these fields are already visible via a template override, but I can't get this working on Minitek Wall Pro :(
Any idea how to achieve this?

Kind regards,
nieta
anita van dalen
Minitek Wall Pro - Professional Subscription
Monday, 18 November 2019 16:36 EET
Hi Nieta,

You can achieve this with a template override for Minitek Wall.

First of all, you must create a template override as described in the documentation.

Then you can use the following code to display custom fields.

Inside the template override file (eg. override_columns.php)
just after the items loop starts, add this:


$item->jcfields = FieldsHelper::getFields('com_content.article', $item, true);
$fields = [];
foreach($item->jcfields as $jcfield)
{
$fields[$jcfield->name] = $jcfield;
}

Then, you use the following code to display fields anywhere in the template file:

<?php foreach ($fields as $field) { ?>
<p><?php echo $field->title; ?></p>
<p><?php echo $field->value; ?></p>
<?php } ?>
Yannis
Support Team

  Please post a rating at the Joomla! Extensions Directory

Monday, 18 November 2019 17:12 EET
Hi Yannis,

Thank you for your quick reply. I created a template override as described.
With your code the custom fields show the fields' label, but not the field value...

Also changed this line:
$fields[$jcfield-&gt;name] = $jcfield;
To:
$fields[$jcfield-&gt;name] = $jcfield;
anita van dalen
Minitek Wall Pro - Professional Subscription
Monday, 18 November 2019 17:36 EET
Yes, there seems to be a formatting issue with the last line.

It should be
$jcfield->name
Yannis
Support Team

  Please post a rating at the Joomla! Extensions Directory

Monday, 18 November 2019 18:08 EET
Thanks!
anita van dalen
Minitek Wall Pro - Professional Subscription
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.

Search