Apply templates to raw HTML from CDATA
This is an open discussion with 4 replies, filed under XSLT.
Search
Maybe if you would apply a text formatter
to that textarea
, you could return in your datasource a formatted
field's content, that is the markup directly.
Using a text formatter is my suggestion as well.
It has been thoroughly discussed—and it's a good decision—to wrap raw input in CDATA
sections. Formatters are the tool of choice to generate HTML from textarea contents.
Thanks for your help.
I ended up defining a basic formatter that just outputs the input and solved the problem.
Cool!
Thanks @michael-e for the confirmation.
Create an account or sign in to comment.
I have a field in a section, that contains HTML, which I want to output after some transformations.
I old versions of Symphony, I was able to use a textbox field to do this. In the data source I could select the raw HTML, which would be included as something like this:
So, in my XSLT I just needed to call
to pass the HTML to the templates that would make some transformations to the HTML (e.g. replace the
{$root}
with an URL).Apparently this does not work anymore. Now the raw HTML is inside a CDATA, that is, the XML that I have to transform is something like this:
My question is, how can pass the HTML contained in the CDATA to templates? Is there any type field that allows me to get raw HTML directly in the data source?