Iframe
17 Feb 20228 minutes to read
When the iframeSettings
option is enabled, the Rich Text Editor creates the iframe element as the content area on control initialization; it is used to display and editing the content. In content area, the editor displays only the body tag of a < iframe >
document.
<ejs-richtexteditor id="iframe">
<e-richtexteditor-iframesettings enable="true"></e-richtexteditor-iframesettings>
<e-content-template>
<p>
The Rich Text Editor control is WYSIWYG ('what you see is what you get') editor that provides the best user experience to create and update the content.
Users can format their content using standard toolbar commands.
</p>
<p><b> Key features:</b></p>
<ul>
<li><p> Provides < IFRAME > and < DIV > modes </p></li>
<li><p> Capable of handling markdown editing.</p></li>
<li><p> Contains a modular library to load the necessary functionality on demand.</p></li>
<li><p> Provides a fully customizable toolbar.</p></li>
<li><p> Provides HTML view to edit the source directly for developers.</p></li>
<li><p> Supports third - party library integration.</p></li>
<li><p> Allows preview of modified content before saving it.</p></li>
<li><p> Handles images, hyperlinks, video, hyperlinks, uploads, etc.</p></li>
<li><p> Contains undo / redo manager.</p></li>
<li><p> Creates bulleted and numbered lists.</p></li>
</ul>
</e-content-template>
</ejs-richtexteditor>
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}
}
Iframe Attributes
The editor allows you to pass an additional attribute to body tag of a < iframe > element using attributes fields of the attributes
fields of iframeSettings
property. This property contains name/value pairs in string format. It is used to override the default appearance of the content area.
<ejs-richtexteditor id="iframe" created="created">
<e-richtexteditor-iframesettings enable="true"></e-richtexteditor-iframesettings>
<e-content-template>
<p>
The Rich Text Editor control is WYSIWYG ('what you see is what you get') editor that provides the best user experience to create and update the content.
Users can format their content using standard toolbar commands.
</p>
<p><b> Key features:</b></p>
<ul>
<li><p> Provides < IFRAME > and < DIV > modes </p></li>
<li><p> Capable of handling markdown editing.</p></li>
<li><p> Contains a modular library to load the necessary functionality on demand.</p></li>
<li><p> Provides a fully customizable toolbar.</p></li>
<li><p> Provides HTML view to edit the source directly for developers.</p></li>
<li><p> Supports third - party library integration.</p></li>
<li><p> Allows preview of modified content before saving it.</p></li>
<li><p> Handles images, hyperlinks, video, hyperlinks, uploads, etc.</p></li>
<li><p> Contains undo / redo manager.</p></li>
<li><p> Creates bulleted and numbered lists.</p></li>
</ul>
</e-content-template>
</ejs-richtexteditor>
<script>
function created() {
this.setProperties({
iframeSettings: {
attributes: {
readonly: 'readonly'
}
}
}, false);
}
</script>
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}
}
Adding External CSS/Script File
The editor offers you to add external CSS file to style the < iframe >
element. Easily change the appearance of editor’s content using an external CSS file using styles
field in iframeSettings
property.
Likewise, add the external script file to the <iframe>
element using scripts
field of iframeSettings
to provide the additional functionalities to the Rich Text Editor.
<ejs-richtexteditor id="iframe">
<e-richtexteditor-iframesettings enable="true" resources="@ViewBag.resources"></e-richtexteditor-iframesettings>
<e-content-template>
<p>
The Rich Text Editor control is WYSIWYG ('what you see is what you get') editor that provides the best user experience to create and update the content.
Users can format their content using standard toolbar commands.
</p>
<p><b> Key features:</b></p>
<ul>
<li><p> Provides < IFRAME > and < DIV > modes </p></li>
<li><p> Capable of handling markdown editing.</p></li>
<li><p> Contains a modular library to load the necessary functionality on demand.</p></li>
<li><p> Provides a fully customizable toolbar.</p></li>
<li><p> Provides HTML view to edit the source directly for developers.</p></li>
<li><p> Supports third - party library integration.</p></li>
<li><p> Allows preview of modified content before saving it.</p></li>
<li><p> Handles images, hyperlinks, video, hyperlinks, uploads, etc.</p></li>
<li><p> Contains undo / redo manager.</p></li>
<li><p> Creates bulleted and numbered lists.</p></li>
</ul>
</e-content-template>
</ejs-richtexteditor>
public class HomeController : Controller
{
public ActionResult Index()
{
ViewBag.resources = new
{
styles = new[] { "myStyle.css" }
};
return View();
}
}