Search code examples
tridiontridion-2011

how to add the custom elements in the RTF field of a component in SDL Tridion 2011 Sp1


I want to add custom elements in the source of a Rich Text field in SDL Tridion. Is there any chance to add them by changing the XSL filtering in the Schema?

Example:

I have a RTF field "text" in SDL Tridion. I want to add something like this:

<text>
    <customelement>the text added through the custom element</customelement>
</text>

Can somebody help me on this?

Thanks.


Solution

  • I'm assuming you're trying to add some HTML5 element in your rich text field.

    If you don't want to modify any Tridion installation files, which is something you should try to avoid at all times you could try the following:

    • Include a CSS class in your rich text field options.
    • Let the users put the css class on a div, span or anchor tag in your rich text field.
    • On the front-end with some magic Javascript and jQuery you could try to change the element to the custom element you would like.