N2 CMS - 我的项目未显示在树中
有人熟悉 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
发现问题,因为我从 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