• Hi

    I really like your plugin and would like to use this for my next project. However, I don’t know if vsel can handle this scenario:

    On the startpage I need to list 4 events, the latest from each of 4 categories, in correct date order. Can this be done with the shortcodes? I have tried to accomplish this with custom css targeting each category like this:

    .category-name:not(.first-child)

    But it doesn’t work… any insight or help at hand?

    The page I need help with: [log in to see the link]

Viewing 12 replies - 16 through 27 (of 27 total)
  • Thread Starter Sinkadus

    (@niwin)

    Well, the site has 4 areas that they promote the same, with events of different kinds. The home page will in essence just be 4 events from these four areas, each full screen, and giving them chronological order would make the need for hierarchy between them unnecessary – the latest would be on top, giving the site natural variation of what area is in focus. Thats the idea.

    But if thats not possible, I’ll tell my client that they need to choose the order of the areas, its as simple as that. Or use ordinary shortcode and just limit all events to 4, so sometimes not all areas will be repressented on the home page…

    Thread Starter Sinkadus

    (@niwin)

    Another question regarding the snippet: is it possible to add unique classes to the different categories, for styling purposes?

    Now is is only like this:

    <div class="vsel-meta-cats">Folkets bio</div>

    Would be perfect if it where to be something like:

    <div class="vsel-meta-cat-folkets-bio">Folkets bio</div>

    Or something to the same effect…

    Plugin Author Guido

    (@guido07111975)

    Hi,

    Have updated this reply.

    This will work:

    
    $output .= '<div class="vsel-meta-cats '.esc_attr($cat->slug).'">'.esc_attr($cat->name).'</div>';

    Guido

    Plugin Author Guido

    (@guido07111975)

    But if you want to target whole event content, you need to change this:

    $output .= '<div id="event-'.get_the_ID().'" class="vsel-content">';

    Into:
    $output .= '<div id="event-'.get_the_ID().'" class="vsel-content '.esc_attr($cat->slug).'">';

    Guido

    Thread Starter Sinkadus

    (@niwin)

    That is awesome, thank you very much!

    Have you reached a verdict regarding possibility to sort them by event date? Was it impossible (or maybe possible, but way too much work…)? I still have hope, but ofc not expecting more miracles ??

    Plugin Author Guido

    (@guido07111975)

    Don’t think I can make that work the way it is now, because (as mentioned before) the cats query is the main query. First I get all cats, second the first upcoming event of every individual cat. So your event list contains a separate query for every event cat.

    I can try to turn around the queries. First get all upcoming events, second list only 1 event per category.

    But meanwhile I have spent quite some free time on this, for something I probably not gonna add to VSEL. You don’t have enough knowledge to try yourself?

    Guido

    Thread Starter Sinkadus

    (@niwin)

    Yeah that make sense. My initial thought was to make that happen with my suggested shortcode posts_per_category. But that was before I understood how complex this would be to implement…

    I realize this has taken up a lot of your time already, you really are a shining example of a plugin author ??????

    Unfortunately I’m terrible at php so doing these things myself is not possible :/

    Thread Starter Sinkadus

    (@niwin)

    Update (sort of): I noticed that it’s not the closest event in each cat that is displayed with the snippet shortcode. This was obvious when I added the 4 events by using four different shortcodes:

    [vsel posts_per_page="1" event_cat="folkets-bio" pagination="false"]

    Just changed the cat name and then put these on top of each other in my page builder. The output is the latest event in each category.

    So, now I’m a bit confused as to why the snippet is better than the four shortcodes?

    Maybe the latest-date thing can be fixed, but the sort-by-event-date thing is still a something that is too complicated to manage, right?

    Plugin Author Guido

    (@guido07111975)

    So, now I’m a bit confused as to why the snippet is better than the four shortcodes?

    Hm, basically it’s the same… only difference when using the snippet is that it’s wrapped in 1 main cats query. And the snippet is custom made (only shows the info you need).

    Guido

    Thread Starter Sinkadus

    (@niwin)

    Yes, I understand. Unless you get some inspiration and solve the problem of sorting by date (in the custom snippet), I guess it doesn’t matter much with shortcode I use.

    Still prefer your plugin over The Event Calendar, so I’ll stick with it either way ??

    Plugin Author Guido

    (@guido07111975)

    Most other plugins are bloaded, for me this was the main reason to create VSEL. Besides that, most other event plugins include their own styling that often hooks into theme styling. Styling of VSEL is quite basic, mostly depends on theme styling.

    Personally I only want to improve the saving of data in database. Currently every individual plugin setting has its own option in the options table in database. So many entries. It’s better to have 1 single option that contains an array of settings. But I cannot simply change that structure without losing all current settings that a user has.

    Guido

    Thread Starter Sinkadus

    (@niwin)

    Agreed!

    Well, thanks for all support and for really trying to solve my unique problem of event listing. I really appreciate it!

Viewing 12 replies - 16 through 27 (of 27 total)
  • The topic ‘Limit to latest in each category’ is closed to new replies.