Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > Strict DOCTYPEs View modes: 
User avatar
Member
Member
chris-obergine - 9/15/2009 6:06:20 AM
   
Strict DOCTYPEs
Hello, I'm trying to get the rendered HTML of Kentico to conform to a strict XHTML 1.0 doctype. I see that the xhtmlConformance attribute of web.config is set to "Strict", but the page still renders some html elements (e.g. inputs) with name attributes. Can I do anything to get the rendered HTML from Kentico to not include name attributes?

I saw a thread here that touched on this:

Hidden inputs & html validation

That thread was posted under v 3.x of Kentico so I was hoping that maybe something had changed in v 4.x to make conforming to a strict doctype possible. If not, can you tell me if this will make it in to any future releases of Kentico please?

Thanks,
Chris


User avatar
Member
Member
ryan.wheale-gmail - 9/18/2009 7:37:36 PM
   
RE:Strict DOCTYPEs
The "name" attribute for input elements is completely valid XHTML 1.0. The "name" attribute has been deprecated on other elements, such as a, iframe, img, etc.

Your markup wont validate because there is a hidden input element that must fall inside of a block element (such as a div). If you have the full source code, you can modify the following (note the <div> and </div> which should not exist in your code):

\UIControls\Pages\CMSPage.cs (368): Page.ClientScript.RegisterClientScriptBlock(typeof(string), "CMSLanguage", "<div><input type=\"hidden\" name=\"lng\" id=\"lng\" value=\"" + HTMLHelper.HTMLEncode(CMSContext.PreferredCultureCode) + "\" /></div>");


\UIControls\Pages\DocumentBase.cs(522):
string tags = "<div><input type=\"hidden\" name=\"lng\" id=\"lng\" value=\"" + HTMLHelper.HTMLEncode(CurrentUser.PreferredCultureCode) + "\" /></div>\n";

If you do not have the full source code, I have been told that this issue was resolved in 4.1. Hope that helps.

~Ryan

User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 9/22/2009 5:25:29 AM
   
RE:Strict DOCTYPEs
Hi,

This issue is fixed in Kentico CMS 4.1, so please consider upgrade to 4.1 in case you are still using version 4.0.

Best Regards,
Miroslav Remias.