-
Notifications
You must be signed in to change notification settings - Fork 57
Clean the html for the export
Steve Hannah edited this page Sep 2, 2016
·
1 revision
- Override the display() of the field to strip the tags... but this would affect all parts of the application where the HTML fields are displayed.
- Create a grafted field, then override its display to show the stripped contents of the HTML area field.
__sql__ = "select t.*, null as stripped_field from mytable t"
[original_field]
widget:type=htmlarea
visibility:csv=hidden
[stripped_field]
visibility:csv = visible
visibility:list=hidden
visibility:browse=hidden
visibility:find=hidden
Then in the delegate class:
function stripped_field__display($record){
return html_entity_decode(strip_tags($record->val('original_field')), ENT_QUOTES, 'UTF-8');
}