N2 CMS - 我的项目未显示在树中

发布于 2024-08-25 05:22:03 字数 1062 浏览 2 评论 0原文

有人熟悉 N2 CMS 吗?

我刚刚开始使用它,到目前为止一切顺利,但我有一个问题,我相信你们会知道出了什么问题。

我有这个简单的 Item 类...

using N2;
using N2.Details;
using MVCSite.ContentCMSItems;

[PageDefinition("Home page", Description = "The Page for the home page")]
[WithEditableName]
public class PageItem : AbstractBaseClass
{
/// <summary>
/// There are code snippets to help generate these properties.
/// Look in the snippets directory of the package.
/// </summary>
[EditableFreeTextArea("MainText", 97)]
public virtual string MainText
{
    get { return (string)GetDetail("MainText"); }
    set { SetDetail("MainText", value); }
}

    [EditableFreeTextArea("Home Page Fotter Text", 100)]
    public virtual string FooterText
    {
        get { return (string)GetDetail("Home Page Fotter Text"); }
        set { SetDetail("Home Page Fotter Text", value); }
    }
}

在编辑模式下,N2 CMS 会选择它,我可以创建一个页面并填写所有数据。

完成此操作后,我希望在开始页面下方的树中看到它,但它从未显示。

所有数据都在数据库中,但不在树中,所以一旦创建,我就无法编辑它:(

任何人都可以建议我做错了什么吗?

感谢您的时间

Truegilly

Anyone familier with N2 CMS ??

ive just started using it, and so far so good, but i have an issue that im sure you guys will know whats wrong.

i have this simple Item class...

using N2;
using N2.Details;
using MVCSite.ContentCMSItems;

[PageDefinition("Home page", Description = "The Page for the home page")]
[WithEditableName]
public class PageItem : AbstractBaseClass
{
/// <summary>
/// There are code snippets to help generate these properties.
/// Look in the snippets directory of the package.
/// </summary>
[EditableFreeTextArea("MainText", 97)]
public virtual string MainText
{
    get { return (string)GetDetail("MainText"); }
    set { SetDetail("MainText", value); }
}

    [EditableFreeTextArea("Home Page Fotter Text", 100)]
    public virtual string FooterText
    {
        get { return (string)GetDetail("Home Page Fotter Text"); }
        set { SetDetail("Home Page Fotter Text", value); }
    }
}

In edit mode, N2 CMS picks it up and i can create a page and fill in all the data.

Once this is done i expect to see it in the tree, below my start page, but it never shows.

All the data is in the database but not in the tree, so once its created i cannot edit it :(

can anyone suggest what im doing wrong ??

thanks for your time

Truegilly

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情徒 2024-09-01 05:22:03

发现问题,因为我从 N2CMS MVC 示例项目复制了它继承的 AbstractBaseClass,它包含导致此问题的方法。删除这些后,它现在显示在树中。

特鲁吉利

Found the problem, as i copied the AbstractBaseClass which it inherits, from the N2CMS MVC example project, it contained methods that caused this problem. After removing these it now shows in the tree.

Truegilly

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文