How do I load the "insert templates" as well as the editor at the same time

Last post 05-10-2006, 9:24 AM by ontargetbill. 4 replies.
Sort Posts: Previous Next
  •  05-09-2006, 2:00 PM 18981

    How do I load the "insert templates" as well as the editor at the same time

    HI,
    I was wondering how I could call the "Insert Templates" button without acutally clicking on it. This way when a user clicks a like to access the editor they will get a choice of templates to choose at the start.
     
    thanks,
    ontargetbill
  •  05-09-2006, 2:13 PM 18982 in reply to 18981

    Re: How do I load the "insert templates" as well as the editor at the same time

    ontargetbill,
     
    You have the following two options:
     
    1.  Load the default template when page loads
     
    Demo:
     
    2. When the page loads, call Cute Editor JavaScript API to open the "insert template" dialog:
     
    Demo:
     
     
    Code:
     

        // get the cute editor instance
        var editor1 = document.getElementById('<%=Editor1.ClientID%>');
        editor1.ExecCommand("InsertTemplate");
     
     
     

    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

  •  05-09-2006, 2:45 PM 18987 in reply to 18982

    Re: How do I load the "insert templates" as well as the editor at the same time

    Thanks for the replay,
    Were e exactly do I put the new varibles?

    Another question:
     
    2. My web application is based on MSSQL and Coldfusion .  I would like to give my users the ability to save their individual templates to a users directory based on their login credentials. I've noticed the security config files do I need to create a new config file each each user? Thanks OnTargetbill
     
     
     
     
  •  05-09-2006, 4:07 PM 18991 in reply to 18987

    Re: How do I load the "insert templates" as well as the editor at the same time

    Please put the following code in the end of your aspx page:
     

     <script>
     
      _EditorOnLoad();
     
      function _EditorOnLoad()
      {
           // get the cute editor instance
           var editor1 = document.getElementById('<%=Editor1.ClientID%>');
      
           //Get the editor content 
           var editdoc=editor1.GetDocument();  
           if(!editdoc.body) //Not Ready
           {
                setTimeout(_EditorOnLoad,10);
                return;
           }
           else
           {  
                // Set the editor
                editor1.setHTML("Hello");
           }
      }

      </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

  •  05-10-2006, 9:24 AM 19012 in reply to 18991

    Re: How do I load the "insert templates" as well as the editor at the same time

    Great everything looks good except when I click on the "Insert templates" the template isn't copied to the editor just says Hello.
     
    The code is as follows:

    <script runat="server">
     void Page_Load(object sender, System.EventArgs e)
      {
         if (IsPostBack)
      {
       Literal1.Text = "<h2>The HTML you typed is...</h2><br>";
       Literal1.Text += Server.HtmlEncode(Editor1.Text);
         }
      else
      {
       Editor1.Text = "Type Here";
      }
     
     }
     public void Submit(object sender, System.EventArgs e)
     {
      Literal1.Text = "<h2>The HTML you typed is...</h2><br>";
      Literal1.Text += Server.HtmlEncode(Editor1.Text);
     }
    </script>
    <script>
     
      _EditorOnLoad();
     
      function _EditorOnLoad()
      {
           // get the cute editor instance
           var editor1 = document.getElementById('<%=Editor1.ClientID%>');
           editor1.ExecCommand("InsertTemplate");
           //Get the editor content 
           var editdoc=editor1.GetDocument();  
           if(!editdoc.body) //Not Ready
           {
                setTimeout(_EditorOnLoad,10);
                return;
           }
           else
           {  
                // Set the editor
                editor1.setHTML("Hello");
           }
      }
      </script>
    Thanks,
    Bill
     
View as RSS news feed in XML