Hi. I want my user to be able to insert html code for an iframe like the code below. It seems that neither the Richtext editor nor the Textstring datatype is able to insert the code properly.
Is there some other method for this avoiding the hardcoding of the iframe code?
What I normally to is to use the multiple texts for scrips, then what you need to do when you output this in one of your templates, or in a partial view or partial view macro file is to use the @Html.Raw method.
You can do something like this,
@Html.Raw(CurrentPage.PropertyAlias)
Where the property alias is the alias of the field with the iframe.
Thank you for a quick reply, Dennis. I will give it a try later on but it looks as if this is the way to do it and then I will write in the forum what the results are.
Insert code from the Umbraco content section
Hi. I want my user to be able to insert html code for an iframe like the code below. It seems that neither the Richtext editor nor the Textstring datatype is able to insert the code properly.
Is there some other method for this avoiding the hardcoding of the iframe code?
The iframe code could be like this:
Suggestions are welcome since my deadline is approaching :-)
Regard, Lars
Hi Lars,
What I normally to is to use the multiple texts for scrips, then what you need to do when you output this in one of your templates, or in a partial view or partial view macro file is to use the @Html.Raw method.
You can do something like this,
Where the property alias is the alias of the field with the iframe.
We also have a video about the method, on Umbraco TV https://umbraco.tv/videos/umbraco-v7/implementor/working-with-umbraco-data/razor-syntax/htmlraw/documentation/
Hope this helps,
/Dennis
Thank you for a quick reply, Dennis. I will give it a try later on but it looks as if this is the way to do it and then I will write in the forum what the results are.
//Lars
Hi guys,
In case you want the editor to create more or less the same markup every time, you could also benefit from making it into a macro.
Hi Both
With a textstring type and html.raw it works fine now. Thank you very much both of you for helping me.
//Lars
is working on a reply...