Home › Forums › Calendar Products › Events Calendar PRO › prepopulating forms
- This topic has 11 replies, 4 voices, and was last updated 10 years, 2 months ago by
Support Droid.
-
AuthorPosts
-
January 21, 2016 at 2:20 pm #1060145
Edwin
ParticipantHello,
I need to prepopulate one of the form fields on the Community Add events page. I understand the HTML aspect, but I don’t know where to find the HTML for the form.
THanks,
Edwin
January 21, 2016 at 3:08 pm #1060161Ronald
ParticipantHi Edwin,
I’d be happy to help you find what you are looking for. Can you tell me which form field you are trying to prepopulate and I can give you instructions.
Thanks
January 21, 2016 at 3:45 pm #1060175Edwin
ParticipantHello Ronald,
For now, the 2 fields I need to populate are the two HOURS fields under START time and END time. Thanks-
January 22, 2016 at 1:07 am #1060267Edwin
Participantand AM/PM on each
January 22, 2016 at 2:09 pm #1060744Ronald
ParticipantHi Edwin,
The location of the datepickers can be found at:
\wp-content\plugins\events-community\src\views\community\modules\datepickers.php
HOWEVER! As you will see when you open that file, if you want to modify something in here, you would be better to create the override within your theme, see the instructions below:
* Event Submission Form Metabox For Datepickers
* This is used to add a metabox to the event submission form to allow for choosing the
* event time and day.* Override this template in your own theme by creating a file at
* [your-theme]/tribe-events/community/modules/datepickers.phpThere are two reasons to do this. Number one, when the plugin gets updated, it will not override your changes, and number two, you don’t have to worry about messing up the plugin itself. You can find specific instruction in our Themer’s Guide.
Let me know if this helps!
January 23, 2016 at 9:10 am #1061069Edwin
ParticipantHi again Ronald and thanks for your help.
I made a copy of the file in the appropriate directory. Unfortunately, the HTML I was expecting to see appears to be encased in a PHP function:
<span class="timeofdayoptions"> @ <?php echo tribe_community_events_form_start_time_selector(); ?> </span><!-- .timeofdayoptions -->Here is what I am hoping to accomplish. Start time should be set to 9pm and End Time should be set to 3am.
Is this possible?
Thanks,
Edwin
January 26, 2016 at 11:33 am #1062663Ronald
ParticipantHi Edwin,
Based on what you want to change, we need to look at a different file:That file is:wordpress\wp-content\plugins\events-community\template-tags.php
There are two areas to change starting on line 203.
$output .= sprintf( ‘‘, $start_hours );
$output .= sprintf( ‘‘, $start_minutes );and then starting at line 234:
$output .= sprintf( ‘‘, $end_hours );
$output .= sprintf( ‘‘, $end_minutes );To set the default value of either of these you would change it to: select name=”EventStartHour” value”2100″> (if using a 24 hour clock, if not set the meridian as well).
I hope that helps!
January 27, 2016 at 9:14 am #1063228Edwin
ParticipantHi Ronald-
the path and file you mentioned doesn’t exist:
wordpress\wp-content\plugins\events-community\template-tags.phpIn fact, I searched through many folders and didn’t find a file named template-tags.php
January 28, 2016 at 12:53 pm #1063992Geoff
MemberHey Edwin,
Sorry about that! Here’s the path:
/wp-content/plugins/events-community/src/functions/template-tags.php
Cheers!
GeoffJanuary 29, 2016 at 12:02 pm #1064644Edwin
ParticipantHi-
One last question on this topic. I have successfully edited the existing file, but I want to create a an override. So my question is… what path should I use for the new file? When I tried the one listed above, it did oot work. Thanks,
Edwin
February 2, 2016 at 3:23 pm #1066619Geoff
MemberGood question. It’s actually not possible to override the template tags file but only our view files instead. If you need to change something in the template tags file, I would suggest going about it through the use of a filter rather than editing the file itself.
Geoff
February 22, 2016 at 8:35 am #1079858Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘prepopulating forms’ is closed to new replies.
