Support

Home Forums Event Espresso Premium HTML in calendar tooltip?

HTML in calendar tooltip?

Posted: February 17, 2017 at 5:56 pm


Annie Ngo

February 17, 2017 at 5:56 pm

Hi,

In EE4, can I enable HTML in the calendar tooltips like it was in EE3?

Thanks!


Lorenzo Orlando Caum

  • Support Staff

February 19, 2017 at 2:30 pm

Hi,

Could you share more feedback on what is happening with the tooltips?


Lorenzo


Annie Ngo

February 20, 2017 at 8:47 am

Hi Lorenzo,

The first event on the events archive shows the excerpt including<br>TEST<br> as italicized and on its own line:

http://stage.concealcarrynorthraleigh.com/raleigh-gun-classes/

But the tooltip has it non-italicized and inline:

http://stage.concealcarrynorthraleigh.com/calendar-of-gun-classes-in-raleigh/

Thanks


Tony

  • Support Staff

February 21, 2017 at 7:10 am

Hi there,

Currently EE4 strips all tags from the description and there is no option to disable this, however the description field used in the tooltip is filtered so if you are comfortable with PHP you can use the FHEE__EE_Datetime_In_Calendar__to_array_for_json__description hook to change the current description for your own without stripping the tags.


Annie Ngo

February 22, 2017 at 8:22 am

Hi there,

I am comfortable with PHP, can you give me a snippet? I tried putting this in my child theme’s functions.php:

add_filter( 'FHEE__EE_Datetime_In_Calendar__to_array_for_json__description', 'my_filter' );
function my_filter( $descr ) {
return strip_tags($descr,'<em><p><br><strong>');
}

Thanks!


Tony

  • Support Staff

February 22, 2017 at 8:55 am

Your filter is currently using strip_tags on a description that already has all of the tags stripped out, you need to replace the description and then set your allowed tags.

You can just use the same code the calendar uses to build the description, only without stripping tags, for example:

https://gist.github.com/Pebblo/d80ea24588fdc02ea21692aef89704d9


Annie Ngo

February 22, 2017 at 11:33 am

Works perfectly – thanks Tony!

The support post ‘HTML in calendar tooltip?’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso