Sitecore v5

Last post 09-08-2005, 11:49 AM by Adam. 3 replies.
Sort Posts: Previous Next
  •  09-07-2005, 4:37 AM 10190

    Sitecore v5

    Hi,
     
    This is a bit of a long shot and I appreciate that it may be more appropriate to speak to Sitecore support (which I have done by the way), however, has anyone got any experience of configuring the CuteEditor that is embedded in Sitecore v5? If so, do you know how to add custom buttons to the CuteEditor toolbars? I know how to do this with CuteEditor directly, I just can't find any documentation on how to do it within Sitecore.
     
    Kind Regards
     
    Andy Maggs
  •  09-07-2005, 11:50 AM 10195 in reply to 10190

    Re: Sitecore v5

    Andy,
     
    We are not familar with the Sitecore.
     
    But it's very easy to add your custom button to the editor.

    Please check the following example:

    http://cutesoft.net/example/customization.aspx

     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  09-08-2005, 7:08 AM 10222 in reply to 10195

    Re: Sitecore v5

    Hi Adam,
     
    Thanks for the reply, however, the page you refer to demonstrates that your excellent control can indeed be extended, but it doesn't actually give any information on how it can be done.  Is there a link to the source or a description of how to do it?
     
    Kind Regards
     
    Andy Maggs
  •  09-08-2005, 11:49 AM 10231 in reply to 10222

    Re: Sitecore v5

    Andy,
     
    You can find the source code of the examples in the CuteEditor download package.

    Here is the source code of the adding custom button:

    <%@ Page Language="C#"%> <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %> <html> <head> <title>ASP and ASP.NET WYSIWYG Editor - Add custom buttons </title> <link rel="stylesheet" href="../example.css" type="text/css" /> </head> <body > <form runat="server" ID="Form1"> <h1>Add custom buttons</h1> <hr /> <P>This example shows you how easy it can be to <b>add your own functions</b> to the CuteEditor with the help of CuteEditor extended functionalities. </P> <br /> <CE:Editor id="Editor1" EditorWysiwygModeCss="../example.css" Height="200" runat="server" TemplateItemList="Bold,Italic,Underline,JustifyLeft,JustifyCenter,JustifyRight,InsertUnorderedList,Separator,Indent, Outdent, insertcustombutonhere"></CE:Editor><BR> <asp:textbox id="TextBox1" Runat="server">OKOK</asp:textbox> </form> </body> </html> <script language="JavaScript" type="text/javascript" > function CatchCommand(editor) { if(event.command=='MyCmd') { editor.ExecCommand("InsertTable"); event.returnValue=false; } } </script> <script runat="server"> void Page_Load(object sender, System.EventArgs e) { if(! this.IsPostBack ) { Editor1.Attributes["oncommand"]="return CatchCommand(this);"; } CuteEditor.ToolControl tc = Editor1.ToolControls["insertcustombutonhere"]; if(tc!=null) { System.Web.UI.WebControls.Image Image1 = new System.Web.UI.WebControls.Image (); Image1.ToolTip = "Insert today's date"; Image1.ImageUrl = "tools.gif"; Image1.CssClass = "CuteEditorButton"; SetMouseEvents(Image1); Image1.Attributes["onclick"]="var d = new Date(); CuteEditor_GetEditor(this).ExecCommand('PasteHTML',false,d.toLocaleDateString())"; tc.Control.Controls.Add(Image1); Button postbutton=new Button(); postbutton.Click+=new EventHandler(postbutton_Click); postbutton.Text="PostBack"; postbutton.Style["vertical-align"]="middle"; tc.Control.Controls.Add(postbutton); System.Web.UI.WebControls.Image Image2 = new System.Web.UI.WebControls.Image(); Image2.ToolTip = "Using oncommand"; Image2.ImageUrl = "tools.gif"; Image2.CssClass = "CuteEditorButton"; SetMouseEvents(Image2); Image2.Attributes["Command"]="MyCmd"; tc.Control.Controls.Add(Image2); //Editor1.AddToolControl("CustomPostBack",postbutton); } } void SetMouseEvents(WebControl control) { control.Attributes["onmouseover"]="CuteEditor_ButtonCommandOver(this)"; control.Attributes["onmouseout"]="CuteEditor_ButtonCommandOut(this)"; control.Attributes["onmousedown"]="CuteEditor_ButtonCommandDown(this)"; control.Attributes["onmouseup"]="CuteEditor_ButtonCommandUp(this)"; control.Attributes["ondragstart"]="CuteEditor_CancelEvent()"; } private void postbutton_Click(object sender, EventArgs e) { TextBox1.Text="PostButton Clicked"; } </script>
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View as RSS news feed in XML