Macro RTE parameter displays html tags with content
Dear Umbraco Forum
I have created a macro with a custom RTE parameter, after adding text, images & links and saving. the rendered content displays html tags along with content.
example i enter 'Hello World' and rendered RTE macro displays <p>Hello World</p>
how can i display content without the html tags ?
I would like to add the macro is used within a RTE property editor.
I have now created a grid layout template.
When i add the same macro to the template, the <p> tag are being rendered when im using @Html.Raw(CurrentPage.ProperyAlias) code.
Macro RTE parameter displays html tags with content
Dear Umbraco Forum
I have created a macro with a custom RTE parameter, after adding text, images & links and saving. the rendered content displays html tags along with content.
example i enter 'Hello World' and rendered RTE macro displays
<p>Hello World</p>
how can i display content without the html tags ?
I would like to add the macro is used within a RTE property editor.
Dibs
Hi Dibs,
Display content without html tags you need to use the method called @Html.Raw() where you pass in the field or a variable.
Like this:
You can find more information about this on Umbraco TV. http://umbraco.tv/videos/umbraco-v7/implementor/working-with-umbraco-data/razor-syntax/htmlraw/
Hope this helps,
/Dennis
Hi Dennis
I have now created a grid layout template. When i add the same macro to the template, the
<p>
tag are being rendered when im using@Html.Raw(CurrentPage.ProperyAlias)
code.Any advise ?
Dibs
Cheers Dennis
solved issue. lack of Razor knowledge on my part.
Thnaks Dibs
My macro parameter RTE sent out tags even after Html.Raw was applied.
I solved it by doing this
Seb
is working on a reply...