- Posts: 5
- Thank you received: 0
Category - Table view with Custom Field
- Edit M. Kovács
- Topic Author
- Offline
- New Member
Less
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
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.
- Tuan Pham Ngoc
- Offline
- Administrator
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:
Hope this helps
Tuan
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
Support
Documentation
Information
Copyright © 2024 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.