Dynamic Content XHTML-editor

Member since: 2007
 

 Hi,

I'm trying to insert dynamic content from the editor. The dynamic content should be a new editor that looks like the one I'm inserting it from. I have managed to make a new editor show up but I don't know how to save it in the correct way. I have only managed to save and show the content in the editor if its text like <p> hello </p> (in a Literal Control). If I try to add a image, the dynamic content box looks like this instead of the orange dynamic content box that I should get.

" hash="+yWD3tOtgAUjHGkjgWAjTl/YGZL/7fPrNTKfXnjKN7s=" disabled="disabled" contentEditable="false" class="dynamiccontent" style="border: 1px solid #111111; background-color: #F8EDA4; padding: 3px;">{DynamicContent:Free text editor} 

If I try to "Save and publish" I get : "No hash value found".

Does anyone know how to save it, and in what kind of control I should try to show it(right now I'm trying to use a asp:Literal).

Here is code fron my FreeTextEditorSettings.ascx.cs (for editmode)

string g = "";         override protected void OnInit(EventArgs e)         {             PropertyXhtmlString oEditor = new PropertyXhtmlString();             oEditor.Name = "_Editor";             oEditor.EditorToolOptions = EPiServer.Editor.EditorToolOption.All;             ctlHtmlEditor.InnerProperty = oEditor;         }         protected void Page_Load(object sender, EventArgs e)         {             if (!IsPostBack)             {                 txtHeadline.Text = ((FreeTextEditor)Content).Headline.ToString();                 txtFreeText.Text = ((FreeTextEditor)Content).FreeText.ToString();                 g = ((FreeTextEditor)Content).Editor.ToString();
//g should be the editor but I don't know how to read back to it. } } public override void PrepareForSave() { ((FreeTextEditor)Content).Headline = txtHeadline.Text; ((FreeTextEditor)Content).FreeText = txtFreeText.Text; IPropertyControl ctr = ctlHtmlEditor.Controls[0] as IPropertyControl; ctr.ApplyChanges(); ((FreeTextEditor)Content).Editor = ctlHtmlEditor.PropertyValue.ToString(); }
Hope sombody can help me!
#26148 Nov 21, 2008 16:47
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
Please login to post a reply