When you write markup for C1 CMS templates and pages you need to write XHTML - HTML5 that also pass as valid XML.
Put your css and script code in files - this help you avoid having to respect xhtml encoding rules in your code.
Below you will more in-depth information on writing XHTML and tips on how you can include unstructured HTML when needed.
You can build HTML5 templates and pages without any problem, but you need to adhere to a few additional rules when doing so. Your markup must be valid XML as well as HTML – XHTML5 if you will.
The reasoning behind this is that the rendering engine of C1 CMS uses features like XElement from the .NET Framework to structure and parse content when assembling webpages. Having very well structured content and a rich set of tools in the framework to structure, parse and manipulate data allows for a more powerful feature set and pretty much guarantees that pages cannot contain broken markup and the HTML source code is more readable.
The rules that XML conformance imposes on you can be a source of frustration unless you know the workarounds. Below you will find the areas of differences you need to know about and learn how to achieve the same result using well-structured markup.
Raw '<' and '&' characters are not allowed except inside CDATA Sections (<![CDATA[ ... ]]>).
Comments (<!—— ... ——>) must not contain double dashes (——).
Content within Comments (<!—— ... ——>) can be ignored.
When writing XML, the concept of namespaces becomes important – they relate elements like <html /> and <div /> to a specific set and allow parsers to much better figure out what is what and avoid name clashes between different sets (namespaces). See http://www.w3schools.com/xml/xml_namespaces.asp for an introduction.
When you write an HTML template, make sure to add the xmlns attribute to the html element.
The following is the example of a minimal XHTML document in C1 CMS. This is an HTML5 document (<!DOCTYPE html>). Two namespace declarations (xmlns="..." and xmlns:f="...") make it very clear which elements play what roles. C1 CMS can easily find the function call element.
<br> should become <br />, and avoid raw & and < characters.
Please see http://www.w3schools.com/xml/xml_syntax.asp for the XML syntax rules.
Specific characters such as < or & should be replaced with &lt; and &amp; respectively.
You can also put these charecters inside a CDATA section like shown above.
You cannot use HTML entities like &copy; and &nbsp;. Use numeric entities or actual characters instead.
HTML entities are not part of the XML standard that's why numeric entities must be used instead, like &#160; (XML) for &nbsp; (HTML).
Please see "HTML Entities" for mapping HTML entities to their XML equivalents.
For example, if you want to use a copyright entity (&copy; in HTML), use the numeric entity &#169; or the © character itself.