• Hi.

    I am really satisfied with your plugin.

    I have added the Calendar Header shortcode on my page and I’m using the category Parameter.

    It shows a dropdown of my categories and the filtering works fine.

    But I want to have this section as simple links instead of a dropdown (only have 3 categories and want them as buttons).

    I was not able to locate the file in the templates folder to change the code.

    Could you please help me with this?

    Thanks

    https://wordpress.org/plugins/event-organiser/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Stephen Harris

    (@stephenharris)

    The filters are created in the javascript file fullcalendar.js – this is a non-minified version of the file that is actually used: fullcalendar.min.js so any changes would have to be copied across. I’m afraid I’m not able to assist you any further with this.

    Please note that changes made to the plug-in are lost when you update the plug-in.

    Thread Starter phoenixobia

    (@phoenixobia)

    Yes I’m aware of updates and changing the core files but I have no other choice, and I will try do override templates if possible.

    Can you at least tell me which part of those files I can edit?

    Basically you’re telling me I paid $76 for nothing.
    Everything I post here or on the paid support forums, gets a not possible response 🙁

    Please try to give more information. If you as the developers of a plugin can’t do this then certainly I can’t either. That’s the whole point of buying a plugin, otherwise I would build one myself if I could.

    Thanks

    Plugin Author Stephen Harris

    (@stephenharris)

    Hi phoenixobia,

    If you’re a customer, please use these forums: http://wp-event-organiser.com/forums. If you can get in touch via this form then I’d be happy to chase up the other forum threads you mentioned.

    While I do try to offer support here for non-customers, the level of support I can offer is, understandably, limited.

    To follow up on my previous message, I was actually incorrect. The file to edit is frontend.js (and frontend.min.js). Specifically these lines: https://github.com/stephenharris/Event-Organiser/blob/2.13.1/js/frontend.js#L151-L155

    You can ‘register’ your own custom button. The key should be the string used in shortcode (e.g. [eo_fullcalendar headerRight="goto"]). The callback is responsible for creating that button (or dropdown) to add the calendar header (see for example eventorganiser_venue_dropdown() for an example of a dropdown).

    Lastly you’ll want to listen to a ‘click’ event for that button. You can retrieve the calendar the button belongs to within that callback with the following:

    var cal_id = $(this).parents('div.eo-fullcalendar').attr('id');
    
        //Alter the calendar via its API
        $('#'+cal_id).fullCalendar(...);
    
        //re-render
        $('#'+cal_id).fullCalendar("rerenderEvents");

    Since you want to filter categories, you probably just need to rerenderEvents and then alter the logic at eventRender (see https://github.com/stephenharris/Event-Organiser/blob/2.13.1/js/frontend.js#L188) – you’ll want to store somehow the last button clicked so you know which category to show. Simply return "<div></div>" to not display an event.

    (Currently the plug-in uses the value of the category/venue/tags dropdowns – if present – to decide whether an event should be rendered or not).

    Plugin Author Stephen Harris

    (@stephenharris)

    Forgot to add, the code snippet above says you can alter the calendar via it’s API. That is to say the API documented here: http://fullcalendar.io/docs1/.

    Filtering by event categories exists outside that API, which is why you’ll probably just need to refresh the calendar, and insert some logic at eventRender which decides which events to show.

    EO uses version 1, but in 3.0.0 this is being updated to version 2.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Event categories as links instead of dropdown’ is closed to new replies.