Try our conversational search powered by Generative AI!

Inline dope controls (wysiwyg, image select, ..)

Vote:
 

I understand that the xhtml editor isn't available in dope mode (toolbar), but what about image selectors for example? Is there any way to have an episerver image selector in dope mode?

 

/J

#36063
Jan 13, 2010 9:55
Vote:
 

Hi!

I just did a simple test to implement a control adapter for the page reference property that adds this feature in a very basic manner with a simple TextBox as edit ui. This makes is possible to add on-page-edit functionality for built in properties. It's also possible to add this functionality directly in the property controls that you have control over.

Add the following in the adaptermapping.browser file:

<adapter controlType="EPiServer.Web.PropertyControls.PropertyPageReferenceControl" adapterType="EPiServer.TestOnPageEditAdapter" />

Create your own Control Adapter:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using EPiServer.Web.PropertyControls.Adapters;
using System.Web.UI.WebControls;
using EPiServer.Core;

namespace EPiServer
{
    public class TestOnPageEditAdapter : PropertyDataControlAdapter
    {
        public override bool SupportsOnPageEdit
        {
            get{return true;}
        }

        private TextBox _onPageEditControl;

        /// <summary>
        /// Creates the "on page edit" controls.
        /// </summary>
        public override void CreateOnPageEditControls()
        {
            _onPageEditControl = new TextBox();
            _onPageEditControl.ID = Name;
            _onPageEditControl.Text = PropertyData.Value.ToString();
            Control.Controls.Add(_onPageEditControl);
        }

        public override void ApplyOnPageEditChanges()
        {
            SetValue(PageReference.Parse(_onPageEditControl.Text));
        }
    }
}

You could of course use the built in Input..... controls in the EPiServer.Web.WebControls namespace but this requires that the user has access to the ui folder since some resources that are used might be in there. A quick test also gave me javascript errors so it might be that a registration of one or more system js files are needed as well.

I hope this will get you started!
Linus Ekström
EPiServer Development Team

#36081
Jan 13, 2010 13:47
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.