how to use tribe_get_events_title() on non-plugin-based template files?

Home Forums Calendar Products Events Calendar PRO how to use tribe_get_events_title() on non-plugin-based template files?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #136756
    Adam
    Participant

    For compatibility with my theme, I moved the ‘echo tribe_get_events_title()’ to the page header, which is outside the area modified by ECP’s templates.

    It displays fine until I click ‘previous events’ in list view. When I click that, the events list updates and so does the URL, but because it is using AJAX the tribe_get_events_title() – generated text still says “Upcoming Events” and not “Past Events” unless I manually refresh the page.

    Is there a way to make sure all text generated by the plugin’s functions stays in sync with the AJAX page view?

    #138796
    Barry
    Member

    Yeah, unfortunately in those circumstances it will not magically be updated – you’d need to do some extra work.

    You might for instance modify the ajax response to include the correct title (whether by adding an extra property to the JSON response or something sneaky like keeping the code to echo out the title within the events template – but do so within the attribute of a hidden input element, or something of that order) and cause your own title element to be updated from there.

    This is very much customization territory, though, so we’ll have to leave it to you to iron out the details. Good luck!

    #138897
    Adam
    Participant

    is there some sort of documentation as to what’s happening with the javascript stuff? Some event that fires after the info refreshes, or something I can hook onto?

    #139439
    Barry
    Member

    Yes, take a look at the tribe_events_calendar_ajax_post() function in resources/tribe-events-ajax-calendar.js – the docblock for that function covers some of the actions you might hook into.

     

    #686296
    Barry
    Member

    Hi! It’s been a while so I’m going to go ahead and close this thread. If we can help with anything else, though, please don’t hesitate to create new threads as needed. Thanks!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘how to use tribe_get_events_title() on non-plugin-based template files?’ is closed to new replies.