prepopulating forms

Home Forums Calendar Products Events Calendar PRO prepopulating forms

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1060145
    Edwin
    Participant

    Hello,

    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

    #1060161
    Ronald
    Participant

    Hi 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

    #1060175
    Edwin
    Participant

    Hello Ronald,

    For now, the 2 fields I need to populate are the two HOURS fields under START time and END time. Thanks-

    #1060267
    Edwin
    Participant

    and AM/PM on each

    #1060744
    Ronald
    Participant

    Hi 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.php

    There 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!

    #1061069
    Edwin
    Participant

    Hi 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

    #1062663
    Ronald
    Participant

    Hi 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!

    #1063228
    Edwin
    Participant

    Hi Ronald-

    the path and file you mentioned doesn’t exist:
    wordpress\wp-content\plugins\events-community\template-tags.php

    In fact, I searched through many folders and didn’t find a file named template-tags.php

    #1063992
    Geoff
    Member

    Hey Edwin,

    Sorry about that! Here’s the path:

    /wp-content/plugins/events-community/src/functions/template-tags.php

    Cheers!
    Geoff

    #1064644
    Edwin
    Participant

    Hi-

    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

    #1066619
    Geoff
    Member

    Good 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

    #1079858
    Support Droid
    Keymaster

    This 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.

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘prepopulating forms’ is closed to new replies.