November Happy Hour will be moved to Thursday December 5th.

Disabling on-page editing

Vote:
 

I am working with a headless build of CMS 12 but cant get my head around how to disable on-page editing for a specific page type. In older versions I've used the UIDescriptor. Does anyone know where to start or maybe already have a solution? 

#291882
Nov 18, 2022 7:51
Vote:
 

Just tried using UIDescriptor on CMS 12 and seems to work as normal (Hidden On Page Editing) i.e. 

[SiteContentType(
   GUID = "DBED4258-8213-48DB-A11F-99C034172A54",
   GroupName = Globals.GroupNames.Specialized)]
[SiteImageUrl]
public class LandingPage : SitePageData
{
    [Display(
        GroupName = SystemTabNames.Content,
        Order = 310)]
    [CultureSpecific]
    public virtual ContentArea MainContentArea { get; set; }

    public override void SetDefaultValues(ContentType contentType)
    {
        base.SetDefaultValues(contentType);

        HideSiteFooter = true;
        HideSiteHeader = true;
    }
}

[UIDescriptorRegistration]
public class LandingPageUIDescriptor : UIDescriptor<LandingPage>
{
    public LandingPageUIDescriptor()
        : base(ContentTypeCssClassNames.Page)
    {
        this.DefaultView = CmsViewNames.AllPropertiesView;
        this.AddDisabledView(CmsViewNames.PreviewView);
        this.AddDisabledView(CmsViewNames.OnPageEditView);

        this.IsPrimaryType = true;
    }
}

#291885
Nov 18, 2022 10:17
redboat18 - Nov 18, 2022 11:49
Yep that worked, I'm not sure what I did wrong but thanks anyway!
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.