Question

In the RTE there are a few predefined block formats like "Headings", "paragraph" and so. Is it possible to do new block formats, and customize the markup that wraps them?

Im doing a newsletter and I would like to use tables around each paragraph

Was it helpful?

Solution 2

There is a button called Insert custom element and there you can add custom para-templates for RTE, however it's possible that you need to enable it and add new 'items'.

Here (DE) in section Einfügen über User-Elemente you have a description for that. Presented snippets should be placed in the PageTS of highest (root) page.

OTHER TIPS

This can be achieved in Page TSconfig:

RTE.default.userElements {
  10 = Various elements
  10 {
    1 = Table
    1.description = Wrap in a table
    1.content = <table><tr><td>|</td></tr></table>
  }
}

To enable the "Insert custom element" button:

RTE.default.showButtons := addToList(user)
RTE.default.hideButtons := removeFromList(user)

Edit: You might need to fiddle with the parser to allow certain tags or attributes. I think this one did it for my case:

RTE.default.proc.HTMLparser_db.allowTags = html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td 

Source: htmlarea manual and this snippet

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top