It seems tridion does not allow the runat="server" in tags within a RTF field. This is how my tcmXHTML.config look like :

numeric-entities: true
drop-empty-paras: true
drop-proprietary-attributes: false
break-before-br: true
word-2000: false
wrap: 0
tidy-mark: false
uppercase-tags: false
uppercase-attributes: false
logical-emphasis: true
fix-backslash: false
char-encoding: utf8
input-encoding: utf8
output-encoding: utf8
fix-uri: true
new-blocklevel-tags: video source
new-inline-tags: video source

Thank you for your help!

2 Answers 2


There are some restrictions, even with the update of the configuration you indicate above (See here for a similar question).

Whatever solution you add, it will likely require a 'technical' element such as using a permitted format like data-runat="server" and then catching this pre-render and reformat as required) - but - do also consider the author.

Going into the source to add a specific 'technical looking' tag is not the optimum experience for editors - perhaps this could be achieved through some other technique such as encapsulating the required text in a specific format with some recognised notation...

then the natural extension to this would be a GUI Extension to facilitate easier selection/formatting for your editors)

Re-iterating the link above, you can see an example of the required code to replace from @johnwinter - additionally you could extend to include the runat="server" as a param such as default or explicitly required such as {h:output runat="server"}tag content here {/h:output}

  • I agree. Your code is supposed to go in your templates, not in your content - and the RTF is no exception to that. Commented Jul 5, 2016 at 11:01
  • I agree but unfortunately the website i'm working on right now is like this. We often have HTML blocks in RTF fields and that's a big problem not to be able to add this runat attribute
    – FieryA
    Commented Jul 5, 2016 at 12:55
  • But "runat=server" isn't HTML, per se, right? Do the HTML blocks differ in each instance or are there certain selections of HTML and parameters that editors insert? If it's anything or a good chunk of presented content, then a "code block" type Component might be a good fit. If the options are limited and inserted within RTF, then some type of placeholder text would be a good fit. Commented Jul 5, 2016 at 14:03
  • 1
    To add to Alvin's comments - we've seen the need for specific tags to be inserted around content (say to encapsulate some specific text for a controlled {web-side} section of clients) - for this we had linked RTF blocks - each with their own metadata to indicate the groups allowed to see (similarly you could have flags/selections to encapsulate the content with specific JAVA tags etc.) - difficult to envision without more clarity on the business, technical and editorial requirements Commented Jul 5, 2016 at 19:12

Finally. I've decided to move the iframe HTML code to a template. Inside, the runat server was still not accepted but i could do something like this.

<script runat="server">
string runat = "runat=\"server\"";  

<iframe src="" <%= runat%></iframe>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.