Support » Plugin: Events Manager » Different Template Layouts for Different Event Category

  • Resolved dadadmin


    In the settings area of the events plug-in I can set my layout for event listings, but that layout is consistent for all layouts. I wanted to have different layouts on different pages if possible.

    For example, I created a nice layout for a page that lists out all of the events from a category. However, If I have two different categories, I want the layout to be a little bit different on each of the category listings defined by my menu items.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Marcus


    NetWebLogic Support

    If you go the template route, you need to disable overriding with formatting in Settings > Pages > Categories

    In your custom template e.g. taxonomy-event-categories.php you’d probably want to use something like archive.php and NOT use the loop, because you just want to know the category and use our object to output the content in the layout you require.

    then, you’d use something like:

    $EM_Category = new EM_Category($term);

    $term would be either the custom taxonomy object, the id or the slug.

    rinse and repeate for specific taxonomy templates e.g. taxonomy-event-categories-music.php

    Formatting is disabled, and my template does resemble the archive template. I’m having trouble outputting anything correct, though. Here’s the code I attempted to replace <?php get_template_part( 'entry' ); ?> with:

      $EM_Category = new EM_Category($term);
    $EM_Category->output('<div class="post-excerpt">
    <div class="post-summary">
    <div class="entry-meta">
    <time class="date" datetime="#_EVENTDATES ">
                #j #F #Y#@_{ \u\n\t\i\l j F Y},  #_EVENTTIMES</time>
    <span class="meta-sep">  /  </span>
    <span class="author"><a href="#_CONTACTPROFILEURL
     #_LOCATIONNAME, #_LOCATIONTOWN #_LOCATIONSTATE</i>{/has_location}<br/>
    <div class="post-thumbnail">

    So my apologies for the last post – i think i understand this correctly now.

    However I still can’t seem to get it to work. Can I confirm that the category ID should be the category slug without apostrophes, and placeholders should be replaced by the html and placeholders per my example above?

    I do this, and I get nothing displayed. Per this page:

    Plugin Author Marcus


    NetWebLogic Support

    I have made a boilerplate file which produces the same result as the default content when ‘Override with Formats’ is enabled.

    The crucial line is here:

    $taxonomy = get_queried_object();
    $EM_Category = em_get_category($taxonomy->term_id);

    This is specific for twenty twelve, but the PHP is the same, so you’ll need to adjust accordingly.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Different Template Layouts for Different Event Category’ is closed to new replies.