SaaS CMS has officially launched! Learn more now.

I created a new page model and adding a new page of that type causes the entire site to 500, with no error details anywhere.

Vote:
 

I created this page, with the string details removed. I get a generic 500 error on every page when I add this page to the content section. If I trash the page, the site works fine again. I have a feeling there's some sort of config or something I'm missing that specific to my environment. But i'm having trouble because there's no details on the error, no lines of code are shown in the debugger, and nothing is logged in the event viewer.

Any ideas what I can do to track down the problem?

[ContentType(
    DisplayName = "",
    GUID = "<uniqueId>",
    Description = "",
    GroupName = "")]
[SitePageIcon]
[AvailableContentTypes(Include = new[] { typeof(HeroPage), typeof(CareerClubPage) })]
[SingleInstance(Scope = SingleInstanceAttribute.InstanceScope.Site)]
public class CareerClubListPage : SitePageData
{
    /// <summary>
    /// Gets or sets the Meta Description format for the page. Hidden because this should not be included for articles.
    /// </summary>
    [ScaffoldColumn(scaffold: false)]
    public override string GeneratedMetaDescriptionFormat { get => base.GeneratedMetaDescriptionFormat; set => base.GeneratedMetaDescriptionFormat = value; }

    /// <summary>
    /// Gets or sets the subtitle property for the page. Hidden because this should not be included for news article pages.
    /// </summary>
    [ScaffoldColumn(scaffold: false)]
    public override string PageSubtitle { get => base.PageSubtitle; set => base.PageSubtitle = value; }

    /// <inheritdoc />
    public override List<ContentReference> GetContentReferences()
    {
        return new List<ContentReference>();
    }

    /// <inheritdoc />
    public override List<SiteBlockData> GetBlocks()
    {
        return new List<SiteBlockData>();
    }
}
#310294
Oct 09, 2023 12:48
Vote:
 

From what i can see, a couple things.

  • The GUID needs a unique value to it.
  • The page properties need to have the virtual keyword adding so that they can edited/rendered out within Optimizely. Currently you have ovverride used in multiple places. An example would be this:

       [[Display(GroupName = SystemTabNames.Content, 
            Name = "Page Subtitle",
            Description = "Page subtitle text",
            Order = 10)]
        [CultureSpecific]
        public virtual string PageSubtitle { get; set; }

#312700
Nov 17, 2023 18:40
* 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.