Re: Programmatically populate the Code Snippet dropdown - ISSUE

  •  05-23-2011, 5:13 PM

    Re: Programmatically populate the Code Snippet dropdown - ISSUE

    Ok, so I created a page like you suggested above.
     
    Here is the code on my ASP page:
    =====================================================================================
    <!-- #include virtual = "/contentmanager/CuteEditor_Files_v6_1/include_CuteEditor.asp" -->
    <html>
        <head>
     </head>
        <body>  
      <form name="theForm" method="post">
      <h1>Multiple Editors Example</h1>
      <br>
      <%
       dim content
       content =  "<P><FONT color=#cd0000><b>This paragraph will be edited by the first instance...</b> </FONT></P>"    
     
       Dim editor
       Set editor = New CuteEditor  'Create a new editor class object     
         
       'Set the ID of this editor class
       editor.ID = "Editor1"
       Editor.FilesPath = "/ContentManager/CuteEditor_Files"
       'The toolbar items needed to be disabled going to this string. Example DisableItemList="Bold, New, Delete"
       editor.DisableItemList = "Save"   
       editor.CodeSnippetDropDownMenuNames = "Code1,Code2,Code3"  
       editor.CodeSnippetDropDownMenuList = "Code1,Code2,Code3"
       editor.Draw()
       
       'Response.Write "<br><br>"
       'Dim editor2
       'Set editor2 = New CuteEditor  'Create a new editor class object     
       'editor2.FilesPath = "/ContentManager/CuteEditor_Files"

       'editor2.ID = "Editor2" 'Set the ID of this editor class
       'editor2.Height = 350
       'editor2.CodeSnippetDropDownMenuNames = "Code1"  
       'editor2.CodeSnippetDropDownMenuList = "Code1"  
       'editor2.Draw()  
       
       'Response.Write "<br><br>"
       'Dim editor3
       'Set editor3 = New CuteEditor  'Create a new editor class object
       'editor3.ID = "Editor3" 'Set the ID of this editor class
       'editor3.Height = 350
       
       'editor3.CodeSnippetDropDownMenuNames = "Code3,CuteSoft"   
       'editor3.CodeSnippetDropDownMenuList = "Code3,<font color=red>CuteSoft</font>"
       'editor3.Draw()  
       ' Retrieve the data from editor: Request.Form("Editor1")
       %>
     
       <br>
       <input type="submit" value="Update"  class="button65" NAME="Submit1">
      </form>
     </body>
    </html>
    Here is what I added to the Common.config file under the folder (CuteEditor_Files/Configuration/Shared/Common.config )
    ==================================================================================
                 <item text="Code1">
                    <value><![CDATA[<strong>This is code 1</strong>]]></value>
                    <html><![CDATA[<strong>This is code 1</strong>]]></html>
                </item>
                <item text="Code2">
                    <value><![CDATA[<strong>This is code 2</strong>]]></value>
                    <html><![CDATA[<strong>This is code 2</strong>]]></html>
                </item>
                <item text="Code3">
                    <value><![CDATA[<strong>This is code 3</strong>]]></value>
                    <html><![CDATA[<strong>This is code 3</strong>]]></html>
                </item>
     When I tried the above code, when I clicked on the code snippet "Code1", "Code2", or "Code3", I was just getting "Code1", "Code2", or "Code3" appearing in the editor.
     
    When I removed the code
    editor.CodeSnippetDropDownMenuNames = "Code1,Code2,Code3"
    editor.CodeSnippetDropDownMenuList = "Code1,Code2,Code3"
    I could then select one of the code snippets "Code1" and get the appropriate code in the editor
    "<strong>This is code 1</strong>"
    I am sure I am missing something here, but could not figure it out.
View Complete Thread