• Resolved jonboldendesign

    (@jonboldendesign)


    First off, LOVE this plugin so far…

    I wanted to use multiple instances of this calendar on a site but default to a category instead of “All”. So if I have two categories “Class” and “Shows” if you go to the Class page, it will default to the class category first and vice versa.

    I promise I searched for this before posting but couldn’t find anything. Thansk!

Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter jonboldendesign

    (@jonboldendesign)

    Actually I figured it out. It’s not the best way to do it, but it will work perfectly for my scenario. I used a javascript switch command in jquery.init_show_calendar.js in the plugin’s JS folder.

    Simple remove this line:

    filter($jq('#aec-filter .all')); // filter: activate all'

    And add your switch based on the page URLS.

    In my case I wanted the calendar on https://www.yoursite.com/page1 to default to category 1 (.cat1), https://www.yoursite.com/page2 to default to category 2 (.cat2), and all others to default to the “all” option (.all).

    var url = window.location.pathname.split("/")[1]; // finds the page name you are on based on the word after the first backlash in the url
    
    switch(url){
    	case "page1": filter($jq('#aec-filter .cat1')); // filter: default to page 1 events
    	break;
    
    	case "page2": filter($jq('#aec-filter .cat2')); // filter: default to page 2 events
    	break;
    
    	default: filter($jq('#aec-filter .all')); // filter: default show all events
    }

    Like I said… not ideal since it’s using page URLs to determine the cast, but it does work.

    Be sure to repalce “page1” and “page2” with the URL names of your pages. You’ll also need to change .cat1 & .cat2 to the proper category ID.

    Plugin Contributor Eran Miller

    (@eranmiller)

    Please refer to this post regarding multiple instances of this calendar.

    Eran

    Thread Starter jonboldendesign

    (@jonboldendesign)

    Excellent!

    It still doesn’t include any option to choose a category to default to, but that’s a pretty obscure feature and my solution works fine for now.

    Thanks so much for your hard work, Eran. I can’t wait for reoccurring events. Your plugin with the best out there with that addition!

    Plugin Contributor Eran Miller

    (@eranmiller)

    Since you asked nicely, I’ve included a shortcode filter option to the next release. [category filter=3] would default to the category with the corresponding id.

    Eran

    p.s. due to complexity recurring events is not going to be released anytime soon, but I am exploring a clone event feature as an interim solution for a near-term release.

    Thread Starter jonboldendesign

    (@jonboldendesign)

    Awesome! Thanks so much, Eran. I always hate to change a plugin if I don’t have to.

    Trust me, I understand the complexity of recurring events. I used to work for a software company that had to figure out that problem and it took FOREVER. Cloning would be awesome.

    Eran:

    The ability for recurring events is on my list too; Having a clone feature is a nice second to that. ?? Likewise, the ability to show ‘default’ categories based on current page & ID!

    I’m managing a radio station’s programming schedule, and much of it is recurring (excluding one-off events in other categories).

    I’m ready to take the next beta for a run whenever you have it ready… Should I just check back here or is there a short list to get put on? ??

    Thanks!

    Patrick

    Plugin Contributor Eran Miller

    (@eranmiller)

    Patrick I’ll post a message in the forum, like I did for the previous beta. I hope to have the beta ready by the end of this weekend.

    Eran

    Thanks Eran!

    Plugin Contributor Eran Miller

    (@eranmiller)

    A new beta has been released for those interested in testing and confirming that it works see this post for details.

    Plugin Contributor Eran Miller

    (@eranmiller)

    Plugin version 0.9.9.1 is now available for download.

    Hi Eran,

    I see a lot of category=”3″ or numbers, but I also saw category=”name” listed in a post somewhere. Should I be using an ID or a name (the category name) when I post a calendar on a page?

    I have a math category, and on my math page, I have the following:

    [calendar=”math”] as the ONLY code on the page, but still…all categories show up. Can you advise me, pretty please! ??

    Sorry, my code is this:

    [calendar category=’math’]

    Is that the correct coding, or should I be using an ID #?

    Plugin Contributor Eran Miller

    (@eranmiller)

    Use the id, as explained on the plugin homepage
    [calendar categories=’1′]
    The category ids are displayed in the gray boxes next to the corresponding category names on the Categories management page

    Oh, I see them! Eran, you rock!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Show Only Certain Categories’ is closed to new replies.