Nov 16, 2009
In last months I'm keeping updated a branch of TinyMCE that can be very interesting for Italian users of Plone (but not only...)
For a preamble for all who didn't know nothing about it, lets me say some words on the Italian law for accessibility: the so called Stanca Act.
The Italian Legislation on Accessibility force all newly created public websites to keep 22 requirements, mainly taken from the WCAG 1.0.
For how Plone is designed (trying to fulfil the WCAG at AA level) a lot of required work is just done (I really like when this happen)!
There are only 2 requirements that keep our head busy every time we develop a new site for an Italian public agency:
- Requirement 1
- The (X)HTML must follow the Strict DTD.
- Requirement 10
- "[...] associate data cells and header cells in data tables that have two or more logical levels of row or column headers."
For us the requirement 1 is a fight against the Transitional DTD of Plone (see also the #4379). Of course, this mean we are always forced to fix manually some Plone templates, but at the end after 4 year this become a well know job!
The real problem is the XHTML code that users put inside the WYSIWYG editor... this must provide us XHTML Strict code someway!
When Kupu was the Plone choice this was a difficult... sometimes our choice was to put a layer between the editor work and the end user, fixing the code using the uTidylib!
In the perfect world the WYSIWYG editor itself must return us the XHTML Strict code...
Again: the requirement 10 is also a WYSIWYG editor problem. Kupu is not helping us to add additional cell info on created tables.
The future (but already available) WYSIWYG editor for Plone 4 is TinyMCE.
The output code of TinyMCE is "more strict" than the Kupu ones... only some minimal fixes are needed. If facts the only validation error found right now if the use of the type attribute for ordered and unordered list (not available in XHTML Strict).
We are keeping updated a TinyMCE branch you can download and test from the collective; it fix the 2 problems described.
First of all: it's not using the type attribute again, but instead it applies a CSS class. An additional small stylesheet make the rest. For details see changes.
The other missing feature is to help the editor to add more attribute to table cells and headers. The simpler solution from the W3C is to provide the scope attribute.
When I started this task I was sure that this was going to steal me a lot of time... but again TinyMCE was a nice surprise!
The patch applied is simple; for some reason TinyMCE support the scope natively but it's disabled (probably only in the Plone version?). As you can see in changes done, my work was very quick (and again: I like when this happen)!
And now?Keeping updated the code is a quite simple task, but I don't like the idea to branches forever. Also note that:
- The first fix above is also valid for XHTML Transitional pages
- The new scope attribute feature can be useful also outside a Stanca Law environment.
We proposed to merge those changes in the TinyMCE core!