A few days ago i asked a question regarding the possibility to add
runat="server" attributes in RTF fields and since it does not seem to be possible. I've chosen to add a HTML5 attribute (allowed in RTF fields) and reformat in C# in TBB:
I use the following block of code :
//get output item from the package Item outputItem = package.GetByName(Package.OutputName); string uglyOutput = outputItem.GetAsString(); string fixedOutput = uglyOutput .Replace("data=\"server\"","runat=\"server\""); package.Remove(outputItem); outputItem.SetAsString(fixedOutput); package.PushItem(Package.OutputName, outputItem);
I tested it with template builder and it works well but i don't know why, when i publish the page in question, it no longer works. The "replace" does not work. I'm sure to use the correct template page so i don't know what's wrong. if anyone has an idea. thanks for your help
EDIT: this TBB is placed as last in the TBB pipeline. I tried to check if something else could create this problem but i didn't find anything. I think i would have got it with the template builder anyway. This is a page template.