Event Custom Fields

  • tripledm
  • Topic Author
  • Offline
  • New Member
  • New Member
More
11 years 5 months ago #38372 by tripledm
Event Custom Fields was created by tripledm
Hello,

I need to add various text fields to display for each event (not for the registration form).

How would I go about adding let's say 2 text fields, 2 text area and 1 file download field?

I found this but it's not very clear as I cannot code and the link on it also does not work.

SHOW EXTRA INFORMATION OF EVENTS USING CUSTOM FIELD (NOTE : CUSTOM FIELDS FOR EVENTS, NOT FOR REGISTRATION FORM)

If you have extra informaiton about the events and want to show to front-end users (beside basic informaiton like Start Date, End Date, Price, Location, Capacity...), you can create custom fields to allow entering these extra information during creating events and these information will be showed when users browse for events from front-end. The steps are :

Go to Event Booking -> Configuration, find the config option Event Custom Field, set it to Yes.
Open the file components/com_eventbooking/fields.xml to define custom fields you want (the custom fields need to be defined via an XML file in this case). There are two custom fields defined by default : A textbox custom field and a textarea custom field. You can define similar custom fields in the fields. The list of supported custom field types can be found at docs.joomla.org/Standard_parameter_types .
After defining custom fields, when you creating event, you will see a new tab called Extra Information. You can enter value for the custom fields you created in this tab and these information will be showed in the frontend when users browse for events.

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

More
11 years 5 months ago #38400 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Event Custom Fields
Hi

Yes. At the moment, if you want to add more custom fields to the system, you will need to add these fields to the mentioned XMl file. Could you please try ?

Tuan

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

More
11 years 4 months ago #39524 by Matia
Replied by Matia on topic Re: Event Custom Fields
Can someone tell me how/where the information placed in the Extra Information boxes get placed in the database? I would like to use this field as a hidden field to hold a number I need in the database, but I would like to remove the "field_speaker=" text so it will only hold the number. I figure I can do this at the location that is information gets placed in the database. Any help?

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

More
11 years 4 months ago #39599 by FrankM
Replied by FrankM on topic Re: Event Custom Fields
You can edit the text in /components/com_eventbooking/fields.xml

Productiv: Joomla 3.5.1 / EB 2.4.3 / PHP 7.0.5
Testsys: Joomla 3.5.1 / EB 2.4.3 / PHP 7.0.5

Sorry, english isn't my native language.

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

More
11 years 4 months ago #39632 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Event Custom Fields
Thanks Frank for helping me answer the forum question as usual. My internet connection is really bad these days and I could not answer forum questions before. Today, I have to come to my friend home to work instead of working at my office :(.

Back to the question of Matia, unfortunately, you cannot use hidden custom field to pass the information to database. So in this case, I am afraid of you will need to customize the code of the extension, add the hidden field to registration form and then store it in the database table you want (not sure what table the data will be stored ?) ?

Maybe you can contact me via Skype so that we can discuss about it together and find a solution. My Skype nickname is tuanpnves.

Regards,

Tuan

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

More
11 years 4 months ago #39695 by Matia
Replied by Matia on topic Re: Event Custom Fields
Actually what I did instead was just add two more fields to the registration form so it was saved in the database that way. Thanks though!

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

More
11 years 4 months ago #39706 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Event Custom Fields
Oh, that's great. But how you make these fields to become hidden fields? If you add the custom fields to registration form, users will still be able to edit the value of these fields ?

Tuan

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

More
11 years 4 months ago #39716 by Matia
Replied by Matia on topic Re: Event Custom Fields
Actually I edited the administrator/components/eventbooking/views/event/tmpl/default.php file. This added a field to the registration page in the admin area only. All it does is display an input box and saves the data within the input box to a specific database column. It is set up the same way you designed the other input fields for a manual/admin registration. I must say, your thought process on this component is very elegant!

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

More
10 years 8 months ago #48051 by bfrylinck
Replied by bfrylinck on topic Re: Event Custom Fields
Hi Matia

I also need this hidden field facility urgently as I need some of my fields to be only visible to event administrators. Can you pse tell me how you did this in the default.php file?

Thank you

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

More
10 years 8 months ago - 10 years 8 months ago #48065 by Matia
Replied by Matia on topic Event Custom Fields
bfrylinck, I opened the file and looked at the admin->Components->EventBooking->Events Tab->New. If you start at the beginning of the PHP file and the beginning of the Add New Event form you will see the similarities. I did this to decide where I wanted the new field to be. I just decided on the bottom. So at the bottom of the form I added
Code:
<tr> <td width="100%" class="key"> Class_schedule ID (Ex: 19509) </td> <td> <input type="text" name="class_schedules_id" id="class_schedules_id" value="<?php echo $this->item->class_schedules_id; ?>" /> </td> </tr>

This will display a textbox for an Admin to fill out. I believe it automatically saves to the database and should be able to pull from the database too just because of how the page was coded. The $this->item->class_schedules_id needs to match the name and id of the new field though. That's it! These are core changes to the component though so they will need to be remade every time the component is updated.
Last edit: 10 years 8 months ago by Matia.

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

Moderators: Tuan Pham Ngoc