Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
using System;
using EPiServer;
using EPiServer.Editor;
using EPiServer.Editor.Tools;
namespace EditorPluginSamples
{
[ ]
public class ChangeEditorCSS : ToolBase, IInitializableTool
{
void IInitializableTool.Initialize(HtmlEditor editor)
{
// Modify editor in editor's PreRender, that executes
// after everything else has been setup.
editor.PreRender += new EventHandler(editor_PreRender);
}
private void editor_PreRender(object sender, EventArgs e)
{
HtmlEditor editor = (HtmlEditor) sender;
string stylesDir = Global.EPConfig.RootDir + "styles/";
switch(editor.CreatorObject.Name)
{
case "Details1":
editor.ContentCssFile = stylesDir + "CustomEditor1.css";
break;
case "Details2":
editor.ContentCssFile = stylesDir + "CustomEditor2.css";
break;
case "Details3":
editor.ContentCssFile = stylesDir + "CustomEditor3.css";
break;
}
}
}
}