Try our conversational search powered by Generative AI!

How to set global settings for Property from code?

Vote:
 

We have a custom property that works good, but when we are adding it to a page from code I can't figure out how to change the globla setting for that property. (see image (https://dl.dropboxusercontent.com/u/14161504/propertySetting.png) on what we like to change to).

We add the property to the page like this:

        [Display(Name = "Brödtext",
            GroupName = SystemTabNames.Content,
            Order = 6)]
        [UIHint("InheritXhtml", PresentationLayer.Website)]
        [BackingType(typeof(InheritXhtml))]
        public virtual string MainBody { get; set; }

    

Is this possible to do from code or do we have to do it from admin?

#79477
Dec 18, 2013 11:52
Vote:
 
        [Display(Name = "Brödtext",
            GroupName = SystemTabNames.Content,
            Order = 6)]
        [UIHint("InheritXhtml", PresentationLayer.Website)]
        [BackingType(typeof(InheritXhtml))]
        public virtual string MainBody { get; set; }

    

#79479
Dec 18, 2013 11:52
Vote:
 

Either you need to add it in admin mode, or you can have an editorsetting that returns the settings that you are interested in.

#79486
Dec 18, 2013 14:27
Vote:
 

You mean some thing like this: http://world.episerver.com/Documentation/Class-library/?documentId=cms/7/1ba6d078-fd13-e4c9-4256-8c086c3e52a3

 

#79520
Dec 19, 2013 10:50
Vote:
 

If you want to do it in code, you can look in this thread.

http://world.episerver.com/Modules/Forum/Pages/Thread.aspx?id=74682&epslanguage=en

#79521
Dec 19, 2013 10:54
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.
* 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.