Add taxonomies to Events+

I’d like to show in the home page two lists of events.

The broad idea is to show first a list of featured events (most of the times would no more than one), then a list of upcoming events (including or excluding the featured one, doesn’t really matter).

The two lists would be also styled differently.

Right now this is not possible with the normal Upcoming Events widget, especially because Events don’t have a check box to mark them as featured/sticky or a taxonomy to filter them by category/tag.

Adding taxonomies on my own is easy, but also useless until Event+ features (read: widgets) don’t allow to filter contents by taxonomy term.

May I expect this feature to be added in a next release of the plugin?

  • fitoussi
    • The Incredible Code Injector

    Hi,

    You can create category taxonomy( using function or custompress plugin) to begin with. Create a category “featured” for your featured events.

    Then you can create two loops in your home page. First loop that will display only events with “featured” category and you can style it in one way. Second loop will display all or number of events ordered by its date. This loop you can style in a different way. Shouldn’t be very difficult. If you need some help let me know.

  • sciamannikoo
    • Site Builder, Child of Zeus

    fitoussi, as I’ve written in my post, I already know how to create and manage taxonomies: this is not a problem.

    The problem is that even creating my own loop, I wouldn’t be able (read: I don’t know how) to retrieve the same information that the Upcoming widget retrieve, as I don’t know if this data is stored in custom fields and in which format.

    If this feature can’t be simply added in Events plugin (and I don’t see why it can’t), at least I would need to know how to get, in my loop, data like:

    – Location

    – Dates (with all the business logic needed when dates are the same, different, the event takes the whole day, is at a specific time, etc.)

    – RSVPs

    – Price

    – etc.

    Again, I think that would be way easier for the developer to just add such a simple feature, as the plugin already does its job (I don’t want to reinvent the wheel), except handling taxonomies.

  • fitoussi
    • The Incredible Code Injector

    I already written a loop to display events that is why I thought I could help. In my loop I have only the title and the start date and time. But you can also display location, price, RSVP. And Most of the details stored in custom fields. With dates I now have only start date and time but I am pretty sure we can get all the date details to show in there.

  • sciamannikoo
    • Site Builder, Child of Zeus

    fitoussi thank you for your help.

    I really hope the developer will come with a solution for this missing feature, but just in case, perhaps is better to find a temporary alternative solution.

    I’d like to see the code of your loop if you don’t mind.

  • fitoussi
    • The Incredible Code Injector

    try this and see if it gives you the details you need. if so all you’ll need to do is to add another loop that will display only featured category and change the classes to give different styling. also where it says ” $count=”3″ ” you can chnage 3 to the number of posts you want to display.

    <?php query_posts( array( 'post_status' => 'publish' , 'post_type' => array( 'incsub_event' ) , 'meta_key' => 'incsub_event_start' , 'orderby' => 'meta_value' , 'order' => 'ASC'   ) ); ?>

    <?php if ( !have_posts() ) : ?>
    <p>No Upcoming Events</p>
    <?php else: ?>

    <?php while ( have_posts() ) : the_post(); ?>

    <?php static $count = 0;
    if ($count == "3") { break; }
    else { ?>

    <div class="event-holder">
    <div class="event-title">
    <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
    </div>
    <div class="event-details">
    <?php
    echo Eab_Template::get_event_details($post);
    ?>

    </div>
    <div class="event-rsvp"?>
    <?php
    echo Eab_Template::get_rsvp_form($post);
    ?>
    </div>
    </div>

    <?php $count++ ; } ?>
    <?php endwhile; ?>

    <?php endif; ?>

  • Timothy
    • Chief Pigeon

    Hey all.

    May I expect this feature to be added in a next release of the plugin?

    I’m not sure what the plans are there, so I’m going to ping Ve on this one and see if he will pop in and comment. :slight_smile:

    Thanks for the feedback as always. Let us know how fitoussi suggestion works for ya for now as well. :slight_smile:

    Take care.

  • sciamannikoo
    • Site Builder, Child of Zeus

    Timothy, I small update.

    I think this post is getting related to this other post I’ve created.

    I believe that having this feature embedded would solve two issues at the same time.

    fitoussi, thank you for the code.

    I was simply curious to see which custom fields you’ve used.

    As I’m going to use LoopBuddy, i will take “inspiration” from you code.

    Still, I’ll push for having this feature as part for the plugin.

    Thanks again.

  • fitoussi
    • The Incredible Code Injector

    Thank you scam for the points.

    However, in the code I provided to you I didn’t use any of the custom field. I simply used the lines of code that the plugin uses to display the event’s information. In my original code I uses custom fields because I didn’t want to display the whole information I wanted only the start date. if you want I can post the names of the custom fields the plugin uses.

  • sciamannikoo
    • Site Builder, Child of Zeus

    fitoussi, thank you for the clarification.

    Actually, you did use one custom field in the query (incsub_event_start) and that’s enough to me to find all other custom fields (I suppose, all “incsub_event_*” fields.

    You also uses some undocumented APIs (or, if they are documented, I don’t know where they are) like “Eab_Template::get_event_details($post)” and “Eab_Template::get_rsvp_form($post)”: these looks interesting.

    As far as you know, does “get_event_details()” render also the period of the event (dates and times), or I must look for a different function for this data?

    Right now I can’t check in the plugin’s code to find out the answer on my own: perhaps you already know the answer.

  • fitoussi
    • The Incredible Code Injector

    the two APIs i grabbed from the plugin’s code that is why it is undocumented. right now what i see is that get_event_detail() gives you start date, start time, end date, end time ,the location and price.

    this is the list of custom fields :

    eab_capacity

    eab_event_recurrence_ends

    eab_event_recurrence_starts

    eab_event_recurring

    incsub_event_attending_count

    incsub_event_end

    incsub_event_fee

    incsub_event_maybe_count

    incsub_event_no_count

    incsub_event_paid

    incsub_event_start

    incsub_event_status

    incsub_event_venue

    incsub_event_yes_count

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.