Editor vs Display switching

Topics: General, Writing modules
Mar 3, 2011 at 9:54 AM

Hi,

I'm creating a part/widget, in the ContentPartDriver I have the Display and Edit methods. I'm not interested in the Display method as I only ever want the widget to show the Edit view.

Currently the Edit view is shown in the Admin and the Display view shown on the main site.

How can I make the Edit view show on the main site and the Display view show in the Admin?

If I had access to the controller this would be simple, but as its a part wrapped in a widget I don't have access to the controller that calls the following methods.

_services.ContentManager.BuildEditor(...);

_services.ContentManager.BuildDisplay(...);

Thanks,

Coordinator
Mar 3, 2011 at 5:00 PM

In this case your Display template must provide the editor, i.e. HTML inputs. Then the buttons can trigger controllers actions, by direct POST or Ajax.