views:

132

answers:

4

In any CMS based site after my work in future client or any client's staff (non-technical) will update website through WYSIWYG editor and it's surely possible they could use deprecated tag or any non-semantic and non validated code. so in this condition would it be better to use transtional doctype over strict for CMS based site?

+1  A: 

Depending on the text editor engine used in your CMS, it may generate both invalid transitional markup as valid strict markup. For instance, if you use TinyMCE for text editing, it generates quite good HTML. If you use plain iframe with designMode enabled, it generates a real HTML mess out of it in Internet Explorer. So I'd say, WYSIWIG controls is not a good criteria for deciding if to use transitional or strict markup.

naivists
ok for tiny CMS but all other editor are not so well
metal-gear-solid
main problem is when client want to give any presentation to any text then WYSIWYG give inline style with <span>
metal-gear-solid
A: 

Use HTML5 doctype. Just

<!DOCTYPE html>

WYSIWYG editors must not make errors, but HTML5 will perform normally and validate when XHTML Strict will fail.

myfreeweb
A: 

I'm sure the will find a way to break the validation of any doctype. so you shouldn't care about this. here is a good explanation http://www.oreillynet.com/lpt/a//javascript/synd/2001/08/28/doctype.html

if you want a "safe" markup. enrich your backend form. dont just give them a plain textarea. provide image upload functionality. distinct input fields for heading, subheading, dates ect. Maybe even do a switch to markdown (if the user dont know html anyway)? that will lower the risk of a broken markup much more rather then choosing the most forbearing doctype.

antpaw
+1  A: 

We use a strict doctype for our Sitecore 6 site. By default, Sitecore won't publish items that contain invalid html (rich text) fields, and you can limit the buttons/options available in the WYSIWYG mode.

adam
Sitecore won't stop publishing , juss would give red error but we can publish. http://alexeyrusakov.com/sitecoreblog/2008/07/03/Sitecore+6+Validation+Part+2.aspx
metal-gear-solid
It can be configured to still publish, but the out-of-the-box behaviour is to disallow publishing of items with invalid xhtml
adam