Change order of wpmudevevents-contentmeta on frontend display

Hi

I would like to edit the display order of the wpmudevevents-contentmeta data on my frontend displays.

In this example i would like to move the Location Name information ( .wpmudevevents-location ) directly below the Event Title.

See http://unievents.simplecsr.com/events/2014/08/sample-live-event-2/

(I am using a custom template in my theme to generate the event display (copied from the default) but the template calls the content meta as one:

<div class="wpmudevevents-contentmeta">
                            <?php echo Eab_Template::get_event_details($post); //event_details(); ?>
			</div>

Is it possible to edit this and ideally preserve changes on update.

Thanks
Chris

  • Vaughan
    • Support/SLS MockingJay

    Hi @chris,

    The Events templating class depends on Events model classes for most of the data bits related to a particular event (including, but not limited to, event title, start/end times, event, etc). The model class (actually, a set of classes) is located in lib/class_eab_event_model.php, and documented there. To make use of it, just convert the $post global to an Eab_EventModel instance, like so:

    global $post;
    $event = ($post instanceof Eab_EventModel) ? $post : new Eab_EventModel($post);

    After this, you can use all the model convenience methods, e.g.:

    if ($event->has_venue_map()) echo $event->get_venue_location(Eab_EventModel::VENUE_AS_MAP, array('width' => '99%'));
    // ...
    $event->get_rsvps();
    // ..
    echo date(get_option("date_format"), $event->get_start_timestamp());
    echo date(get_option("time_format"), $event->get_start_timestamp());

    Hope this helps

  • chris
    • The Crimson Coder

    Hi Vaughan,

    I wish this made more sense to me but the effects of a long night/day I cant get this to work for me.

    Can you give me a step by step for one example.

    "To make use of it, just convert the $post global to an Eab_EventModel instance" - Where should this code go?

    Thanks
    Chris

  • Vaughan
    • Support/SLS MockingJay

    Hi,

    I gave the way to convert the post in the first example.

    so you would place that in your custom template before the loop.

    global $post;
    $event = ($post instanceof Eab_EventModel) ? $post : new Eab_EventModel($post);

    Once done you should be able to grab each event data using the below format from class_eab_event_model.php file.

    So to display the venue.

    echo ' Venue: ' . $event->get_venue();

    Get the RSVP's

    echo 'RSVP: ' . $event->get_rsvps();

    Let me just ask one of our developers to see if he can explain this better & give you a better example.

    Thanks

  • chris
    • The Crimson Coder

    Hi Vaughan,

    That makes much more sense now.

    I can add this to my Custom template.

    I already see the following at the top of my custom file:

    <?php
    
    global $blog_id, $wp_query, $booking, $post, $current_user;
    $event = new Eab_EventModel($post);
    
    get_header( );
    ?>

    1. Where does this new line (copied below) need to go? Or does it need to be integrated into the above?

    global $post;
    $event = ($post instanceof Eab_EventModel) ? $post : new Eab_EventModel($post);

    Some advice on this would be greatly appreciated.

    Thanks again
    Chris

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.