Hi,
have a filed that holds html/css content to be used as a template. but tinymce is stripping out the css when you go to edit the record. the initial code is "tinymce" compliant and saves the full template data correctly... on view the field is holding the correct css and other attributes. but if you "edit" tiny wakes up and decides to remove the css.
i hacked the eweditor.js directly, added the values as suggested, and it appears to work and the design stays in tack:
this is for admin only use that creates these templates. the templates are also scanned when rendered and any <script><?php> tags are stripped so the template fails in the event someone tries to add any script code.
selector: 'textarea',
valid_elements: '*[*]', // Allow all elements with all attributes
extended_valid_elements: 'style[type|media],div[class|style|id]',
valid_classes: {
'*': 'tmce-*' // Allow all classes starting with tmce-
},
valid_styles: {
'*': 'color,background-color,background-image,background-gradient,font-family,font-size,font-weight,padding,margin,border,display,flex,justify-content,align-items,text-align,position,top,left,right,bottom,width,height,max-width,min-width,max-height,min-height,box-shadow,border-radius,overflow,line-height,letter-spacing,text-transform,opacity,z-index,transform,transition,flex-wrap,gap,flex-direction,flex-wrap,grid-template-columns,grid-gap,backdrop-filter'
},
allow_conditional_comments: true,
protect: [
/<style[\s\S]*?<\/style>/g, // Protect style tags
/<link[\s\S]*?>/g // Protect link tags
]
is tinymce.init() valid?, can I add this code to the edit form to add the additional settings?
thanks,