Summary field on edit events page

Hello,
On the Edit Events page, is it at all possible to modify the summary field so that it is a plain text area field and not a rich text field? We want to remove an individual’s ability to add any sort of html markup to the summary field at all.

I know how to hide the wysiwyg toolbar in the summary field with CSS, but unfortunately that doesn’t stop folks from copy/pasting directly from Word documents and bringing certain markup (ex bold, headers, etc) with them.

We’re exploring out options internally - namely, considering where we display the summary field and addressing how we handle content display there on a case by case basis (ex event listing page vs event detail page), but I wanted to throw this question out there simultaneously to have a better understanding of our options.

Thank you!

Sure Janet! A few options come to mind.

Purely on the front-end:

  1. In your calendar theming, you could use some CSS “reset” type code to enforce the styling of your div.event-summary field, overriding the types of things people might be likeliest to paste?
  2. In widgets, you can use {summary_clean} instead of {summary} to strip out any HTML markup whatsoever (this is how _clean suffix works in widgets in general).

Or, for more automated / config options:

  1. There is a setting for which HTML tags are allowed in different fields. Adding something like this to your livewhale/client/private.config.php might do the trick for you:
    $_LW->REGISTERED_MODULES['events']['data_types']['events']['fields_filter']['summary']['tags']='p,strong,em,a'; // allow only paragraphs, bold, italics, and links in event summary

  2. Or finally, a custom module using the onBeforeValidate handler could be added to strip certain HTML tags or do other processing from events before saving. The $_LW->save_data array contains each field, so editing $_LW->save_data['events_summary'] is an option.

I think #3 seems likely to be the closest to what you have in mind, possibly with some of the backend CSS you were already talking about to hide certain fields. Hope this helps!

1 Like