Pass Page Title to ECP mini calendar widget as filter

Home Forums Calendar Products Events Calendar PRO Pass Page Title to ECP mini calendar widget as filter

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #76287
    snorton
    Participant

    I’m interested in finding out if it’s possible to pass the page title through to the Events Calendar widget (minicalendar) as a means of filtering the results. Basically, there are certain pages where I’d like to display only events whose category slug matches the slug of the page.
    I know that what I want can be done by simply registering a unique sidebar for each specific page and manually changing the default widget settings, but I was curious to know if I can take a more dynamic approach to this where I can modify the tax_query $args to include the current page slug as a means of filtering.

    #76558
    Julie Kuehl
    Participant

    Hey snorton,

    I apologize for the failure to get a proper response to you in a timely manner. I just wanted to let you know that we’ve not forgotten about you and will be with you shortly.

    — Julie

    #76579
    Barry
    Member

    Hi Snorton,

    If I’m understanding you correctly then yes, I would think that is very much a possibility. That said, it is also a customization of the sort we can’t really help you with, beyond referring you to our Themer’s Guide and technical docs – as much as anything this sort of task really comes down to general WP development skills as you would probably approach this by altering the query with filters just as you might if you needed to alter WordPress’s own main query.

    We do wish you luck, though, it’s great to hear of interesting things like this being built on top of The Events Calendar 🙂

    Good luck!

    #76588
    snorton
    Participant

    I understand, and I frequent your tech docs for reference (very comprehensive) from time to time. I also understand you guys stay very busy with the many posts for support: you may see that I’ve provided several replies marked as answers for others when I’m awaiting a response. So I presume I should write a filter in my themes functions.php; maybe I can just get a nod of affirmation that I’m working in the right direction?

    function replace_mini_calendar_args() {
    $newargs = array([wp_query ]);
    return $newargs;
    }
    add_filter(‘tribe_events_get_mini_calendar_args’,’replace_mini_calendar_args’);

    #76682
    Barry
    Member

    Yes that certainly sounds like a good starting point, with perhaps tax_query being a good target (out of the various keys in the $args array).

    We do also absolutely appreciate that you take the time to help out here on the forum – it’s great to see – and we wish we could also offer deeper support at times like this; at the same time we are unfortunately limited by the practical realities of responding to large volumes of support requests with limited resources. That’s not too make excuses, but just to explain our position.

    Thanks again – and good luck with this customization 🙂

    #76692
    snorton
    Participant

    I know what you’re saying – I apologize if what I said sounded pretentious even in the slightest. I will take your suggestion and continue this route as I’m fairly certain that I can take it from here.

    Thanks again, Barry.

    #76993
    Barry
    Member

    No problem at all 🙂

    #982038
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Pass Page Title to ECP mini calendar widget as filter’ is closed to new replies.