Category - Table view with Custom Field

  • Edit M. Kovács
  • Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 5 months ago #119488 by Edit M. Kovács
Category - Table view with Custom Field was created by Edit M. Kovács
Hi Tuan,

Could you please help, how I could add a custom field (Training Code) (set in components\com_eventbooking\fields.xml)
to "Category - Table view" (copied to templates\protostar\html\com_eventbooking\common\events_table.php) ?
At the moment it is showed at Event's Extra Information only.

I would add this Custom Field to the Event Manager: Events list as a column as well.

Thank you in advance.

Best regards
Peter

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

More
5 years 4 months ago #119784 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Category - Table view with Custom Field
Hi Peter

1. For adding the field to table layout, you will need to edit code in that field to add the column to the table. To display the value of the field for each event, use this syntax <?php echo $item->name_of_field; ?>, for example <?php echo $item->field_speaker; ?>

2. That's quite hard and will require more custom coding. Basically, data for custom fields are stored in params column in JSON Format, so you will have to get data using JRegistry:
Code:
$params = new JRegistry($row->parmas); echo $params->get('field_speaker');

Hope this helps

Tuan
The following user(s) said Thank You: Edit M. Kovács

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

Moderators: Tuan Pham Ngoc