London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
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;
}
}
}
}