custom field in Upcomming events - Timeline layout

More
5 years 10 months ago #122190 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic custom field in Upcomming events - Timeline layout
Hello

You will need to customize code of the layout and add display the value in the position you want. The file you need to customize is:

components/com_eventbooking/themes/default/common/events_timeline.php

Use the code below to display value of the field:

$params = new JRegistry();
$params->loadString($event->custom_fields, 'JSON');
echo $params->get('veranstalter'); // veranstalter is name of the field

Tuan

Please Log in or Create an account to join the conversation.

More
5 years 8 months ago #123808 by ozwest
I am customising the up-coing events module and I have difficulties displaying custom fields. Here is my code:

<?php
$params = new JRegistry();
$params->loadString($event->custom_fields, 'JSON');
echo $params->get('presenter'); // presenter is name of the field
echo $presenter;
?>

I don't get any value even though there is a value in that field.

Can you advise please? Thank you

Please Log in or Create an account to join the conversation.

More
5 years 8 months ago #123812 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic custom field in Upcomming events - Timeline layout
The code looks correct to me. What version of the extension you are using?Are you using latest version?

Maybe you should echo $event->custom_fields to see whether it contains any value. Base on that, you can check it further

Tuan

Please Log in or Create an account to join the conversation.

More
5 years 8 months ago #123816 by ozwest
Hello Tuan

I am using the latest version 3.9.

I have echoed the $event->custom_fields and there is not value coming back.

However if I look at the events full listing, all the values from the custom fields are there.

Strange indeed.

Please Log in or Create an account to join the conversation.

More
5 years 8 months ago #123820 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic custom field in Upcomming events - Timeline layout
In this case, better submit a support ticket sending us:

- Super admin account of your site
- Link to the page which the module is being displayed

We will check to see why that data is not available and guide you to correct it

Tuan

Please Log in or Create an account to join the conversation.

More
5 years 8 months ago #123841 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic custom field in Upcomming events - Timeline layout
The only thing which is wrong is you need to use $row->custom_fields instead of $event->custom_fields in the module layout

I corrected it on your site and it works good now

Tuan
The following user(s) said Thank You: ozwest

Please Log in or Create an account to join the conversation.

More
5 years 8 months ago #123843 by ozwest
Thanks Tuan, this is awesome.

Please Log in or Create an account to join the conversation.