eo_fullcalendar shortcode: html-tags in event-titles

WordPress Event Management, Calendars & Registration Forums General Question eo_fullcalendar shortcode: html-tags in event-titles

This topic contains 3 replies, has 2 voices, and was last updated by  Stephen Harris 9 years, 8 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #17692

    Hello!
    We use html-tags in some of our events’ titles to style or highlight some words.
    That works fine for everything but the eo_fullcalendar shortcode. The titles are rendered with the html markup, like “Event name with markup”.

    I think it might have to do something with the fact, that the events are loaded via ajax-calls. Is there any way to fix this?

    Thanks for your help and best regards,
    Matthias

    Martin Schuff
    #17702

    Hi Matthias,

    The calendar escapes any HTML before adding it to the calendar. This won’t change in core, but you could use the following snippet of javascript to ensure the event title is added as HTML rather than text:

    wp.hooks.addFilter( 'eventorganiser.fullcalendar_render_event', function( render, event, element, view ){
        jQuery(element).find('.fc-title').html(event.title);
        return render;
    });
    

    You just need to ensure this script is loaded when the calendar is loaded.

    Stephen Harris
    #17710

    Hi Stephen!
    Thanks for the prompt reply.
    It works great, I just had to adjust the selector from .fc-title to .fc-event-title.
    Nice to see how flexible event organiser is. Great work!

    Best regards,
    Matthias

    Martin Schuff
    #17715

    Just a heads up buy in 3.0.0 that will change. 🙂

    Stephen Harris
Viewing 4 posts - 1 through 4 (of 4 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.