Support

Kom i kontakt med vår kundtjänst, lär dig allt via vår SDK eller ladda ner den senaste uppdateringen.

Content type user controls: Rendering av ContentType i admin

2010-09-17 09:29:00 Olle

Jag har gjort en "Content Type User Control" som ärver av UserControlFormField<string> i Value sparar jag undan ett JSON objekt. När man i admin klickar på en sida som använder ovanstående så renderar den värdet i Value.

Kan jag"overrida" detta beteénde på något sätt så jag kan gå in och bestämma hur Admin (ej i edit läge) skall rendera värdet i min kontroll?

All replies

  • 2010-09-17 13:09:09 F

     - http://www.lemoon.se/rules-1

    You manage to brake the only rule

  • 2010-09-17 18:36:13 Olle

    Pardon the rule break, I got confused with all the swedish and english mixed content. Hope for better luck this time then.

    So the question is: I've created a "Content Type User Control" that inherits from UserControlFormField<string>. I save a JSON object in the Value property. 

    Is it possible to override the render of the Value property in Admin mode (the initial preview of a page in Admin, where you are able to enter edit mode for the content) now it just renders the string value.

  • 2010-09-18 13:26:46 Magnus Krona

    Olle, this is possible. By default, all content types are rendered with a default rendering control both in view and edit mode. You can override this by creating your own edit and/or view controls (.ascx) where you can decide exactly how you would like the page to be rendered and what values to show.

    It's not very complicated but a bit too long to explain in a good way in a forum post. I will create a new screencast next week where we show this can be done. I will post on this thread again when its done or check out the screencast section sometimes i the beginning of next week.

  • 2010-09-20 16:47:41 Magnus Krona

    Olle, please check out the new screencast at http://www.lemoon.se/video-tutorials, "Custom View control on a Content Type"

  • 2010-09-20 23:41:48 Olle

    Thanks Magnus that was exactly what I was looking for.