Show Map as default; all-day event as default;

Home Forums Calendar Products Community Events Show Map as default; all-day event as default;

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #123714
    kingconga
    Participant

    Someone has touched on default value for ShowMap and ShowMapLink, but it is still not clear to me exactly what action is needed. I would like to show the map and link by default, and then probably to remove the option from the loading form. Likewise, I would like ‘All Day Event’ selected as default. https://tri.be/support/forums/topic/event-defaults/#post-43197 He has achieved this by editing the calendar rather than the community loader form.
    The above describes (but missing a couple of details for my knowledge) editing “plugins/the-event-calendar/admin-views/events-meta-box.php”. Another point that is not perfectly clear to me in the ‘Themer’s Guide’ is whether I can place a copy of the above file, and if so, what would be its file structure. Would it be “/tribe-events/admin-views/ ” ? I’m not sure that this is the best method but it’s the only lead I could find.

    The bit he’s talking about is this

    <?php if ( !tribe_community_events_is_venue_edit_screen() ) { ?>
    <tr id=”google_map_link_toggle”>
    <td>
    <label for=”EventShowMapLink”>
    <?php _e( ‘Show Google Maps Link’,’tribe-events-community’ ); ?>:
    </label>
    </td>
    <td>
    <input type=”checkbox” id=”EventShowMapLink” name=”EventShowMapLink” value=”1″ <?php checked( get_post_meta( $event, ‘_EventShowMapLink’, true ) ); ?> />
    </td>
    </tr><!– #google_map_link_toggle –>

    <?php if( tribe_get_option( ’embedGoogleMaps’, true ) ) : ?>

    <tr id=”google_map_toggle”>
    <td>
    <label for=”EventShowMap”>
    <?php _e( ‘Show Google Map’, ‘tribe-events-community’ ); ?>:
    </label>
    </td>
    <td>
    <input type=”checkbox” id=”EventShowMap” name=”EventShowMap” value=”1″ <?php checked( tribe_embed_google_map( $event ) ); ?> />
    </td>
    </tr><!– #google_map_toggle –>

    #123907
    Casey
    Participant

    Tim,
    Sorry things weren’t really clear for you in the themer’s guide, but here’s the info that’s most appropriate for you: http://grab.by/vx0E You’ll want to copy over any template files & folders from ‘/wp-content/plugins/events-community/views/’ and put them in your newly created ‘tribe-events/community/’ directory. Make sure to only copy over the files & folders that you’re wishing to override.

    In order to edit the map-related checkboxes, you should only have to override ‘modules/venue.php’ to make the checkboxes always checked (checked=”checked”), and then you could use some CSS to hide the fields from the user (display:none).

    I hope that points you in the right direction, but let me know if you have further questions. Thanks! 🙂

    -Casey-

    #123945
    kingconga
    Participant

    You show that you know exactly what I mean, but you assumed just a little too much knowledge. I placed ” ” around ‘checked’, which is obviously not it because it did a lot of damage to the page.
    Below is one of them, could you please demonstrate where to place (checked=”checked”)
    <td>
    <input type=”checkbox” id=”EventShowMapLink” name=”EventShowMapLink” value=”1″ <?php checked( get_post_meta( $event, ‘_EventShowMapLink’, true ) ); ?> />
    </td>

    After that I will have the problem of hiding it. You suggest by .css – I’d presume by wrappimg it in a <div> but within the table element. I hid many other things from the same form with files in the same folder (eg. cost.php, image.php), but if the default value is set here, in venue.php, then I guess hiding it by commenting out the html is not an option.
    Anyway – it’s a step beyond my current knowledge so please demonstrate.
    Thanks, Tim

    #124588
    kingconga
    Participant

    Luckily someone came by today who knew. It’s like this.
    <td>
    <input type=”checkbox” checked=”checked” id=”EventShowMapLink” name=”EventShowMapLink” value=”1″ <?php checked( get_post_meta( $event, ‘_EventShowMapLink’, true ) ); ?> />
    </td>

    #125111
    Casey
    Participant

    Tim,
    Those links I shared should give you the examples that you’re looking for. Let me know if you still have questions on this. Thanks! 🙂

    -Casey-

    #125840
    Casey
    Participant

    Great! Thanks for confirming that this got you sorted. Since it looks like you’re all set, I’m going to mark this thread “Answered” and close it out.

    By the way, if you have a minute or two, we would love it if you’d write a few words for us here: http://wordpress.org/support/view/plugin-reviews/the-events-calendar?filter=5

    Thanks in advance. 🙂

    Cheers,
    Casey

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Show Map as default; all-day event as default;’ is closed to new replies.