Finding the name of the template that was loaded into the editor

Last post 08-30-2004, 9:06 AM by Adam. 6 replies.
Sort Posts: Previous Next
  •  08-17-2004, 11:21 AM 1520

    Finding the name of the template that was loaded into the editor

    Adam,

     
      I was wondering what procedure you would recommend for finding the name of the template that was loaded into the editor. It doesn't lool like CE provides that information (maybe I am wrong), so I thought about adding an ID to an element in each template then looking for that ID in the HTML from CE to determine which template was loaded. Is there a better way?
  •  08-17-2004, 12:02 PM 1521 in reply to 1520

    Re: Finding the name of the template that was loaded into the editor

     
     
    Please check the user manual for entire list of buttons:

    AutoConfigure Enumeration

     
    Represents Several predefined sets of buttons. These configurations are applied using AutoConfigure property.
     
    You can dynamically set the template . Hope the following code will help you out.
     
    void Page_Load(object sender, System.EventArgs e)
    {
        ...  
        string fieldID = ...//get from somewhere
     
        switch (fieldID)
        {
             default:
             case "title":
             Editor1.AutoConfigure = AutoConfigure.Minimal;
                 break;
             case "message":
                 Editor1.AutoConfigure = AutoConfigure.EnableAll;
                 break;
         }  
    }

    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

  •  08-18-2004, 3:46 PM 1550 in reply to 1521

    Re: Finding the name of the template that was loaded into the editor

    Adam

     
    Sorry...I am using the word template in the wrong context! What I should have said was the "HTML template" loaded into CE with the Insert Templates toolbar button.
  •  08-18-2004, 4:13 PM 1551 in reply to 1550

    Re: Finding the name of the template that was loaded into the editor

     
    You can find the Resources.xml in the ~/cuteeditors/templates/ folder.
     
    The Resources.xml contains all the template definition.
     
    When you add the new template, please make sure you copy the template file to the same folder.
     
     

    <?xmlversion="1.0"encoding="UTF-8"?>

    <templates>

        <template>

            <title>One_column Body with Contents on left</title>

            <description>Create a page with one-column body with contents listed on the left.</description>

            <html>template1.htm</html>

        </template>

        <template>

            <title>One_column Body with Contents on right</title>

            <description>Create a page with one-column body with contents listed on the right. </description>

            <html>template2.htm</html>

        </template>

        <template>

            <title>One_column Body with Contents on left with non-editable regions</title>

            <description>Create a page with one-column body with contents listed on the left. Heading is not         editable.</description>

            <html>template3.htm</html>

         </template>

        <template>

            <title>One_column Body with Contents on right with non-editable regions</title>

            <description>Create a page with one-column body with contents listed on the right. Heading is not editable.</description>

            <html>template4.htm</html>

        </template>

    </templates>

     
     
     

    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

  •  08-19-2004, 2:55 PM 1563 in reply to 1551

    Re: Finding the name of the template that was loaded into the editor

    Adam,

     
        I suppose I am not making myself clear...but we know how to use the HTML templates and do have our own HTML templates in use (great update by the way). And I am not trying to load a "default" template into CE. What I am trying to find is the name of "HTML Template" that a user has chosen from the Insert Templates dialog. I would like to write some code and process the HTML in CE based on the HTML template a user has loaded into CE.

    Example:
    1. A user clicks on the Insert Templates button from the CE toolbar.
    2. The user then selects template1.htm from the dialog to load into CE.
    3. The user then completes the template and we process, then write the contents of CE back to our database based on the name of the template that was loaded into CE.

    I would like to be able to find that template1.htm was loaded into the editor...not sure if this is possible...

  •  08-27-2004, 6:04 PM 1641 in reply to 1563

    Re: Finding the name of the template that was loaded into the editor

  •  08-30-2004, 9:06 AM 1654 in reply to 1641

    Re: Finding the name of the template that was loaded into the editor

    BruceD,

     
    I understood your question. But I don't think it's possible right now.
     
    When the user the insert, only the content of the selected template is inserted into the editor.
     
    The editor has no idea where the content comes from.
     
    Sorry for the inconvenience.
     

    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