Can anyone point me to some rules to follow when using using Rich Text Fields on Tridion Components? I notice that you can enter mark up directly on the Source tab, but if you enter incomplete html then tridion completes it for you, as follows:
<!--Enter this-->
<td>test</td>
<!--And it becomes this-->
<table>
<tr>
<td>test</td>
</tr>
</table>
If you enter invalid markup, then you get a Validation Results popup telling you that your syntax is invalid:
<!--Generates Validation Results popup -->
<badtag>
It seems that there is no problem with adding attributes like id and class to the RTF html, as long as the HTML is valid, but what is everyone else’s experience? Can anyone point me to some additional best practices for what I should and should not try & do in a Component RTF field?
Great Question. The best practices depend on client to client, at least based on my experience with Tridion.
I have seen some clients who are very comfortable and doing more in RTF fields (almost building everything like data capture forms — jeeez..), and seen some clients who are not very comfortable with editor (e.g.; copy and paste from word doc etc..).
I have not seen a best practice document and I don’t think one fits all as this depends on organization or agency skills and comfort.
As rule of thumb, XHTML complaint is a must and that’s what Tridion RTF editor does(good thing). That is the reason why you noticed the cleanup of valid/invalid html format.
This below link from Alvin touches some of the topics, but may not be exactly what you are looking for.
http://www.tridiondeveloper.com/rich-text-format-area-css-classes-vs-custom-xml-nodes
If you find one, please do share with us. I am looking for one as well. 🙂