N2 CMS에서 작업하기 자신의 콘텐츠 유형 Product
을 추가하고 있습니다. Product 클래스를 ContentPageBase
에서 파생 시켰으며 내용 트리에 추가 할 수 있습니다. 그러나 항목을 편집 할 때 필드가 반전 된 것 같습니다 (Title
및 Text
). 모든 예의 항목 (예 : News
)의 경우 Title
이 항상 맨 위에 표시됩니다.N2 CMS에서 항목을 편집 할 때 필드 배치?
내가 그러나 나는 News
클래스 Title
또는 Text
에 대한 특성 재 지정을 참조하지 마십시오 TABNAME에 설정할 수있는 ContainerName
특성이 이해, 그래서 방법이 될 수 있는가?
편집 뉴스 항목
편집 제품
Product.cs (사용자 정의)
using N2;
using N2.Web;
using N2.Details;
using N2.Integrity;
namespace N2.Templates.Mvc.Models.Pages
{
/// <summary>
/// This class represents the data transfer object that encapsulates
/// the information used by the template.
/// </summary>
[PageDefinition("Product")]
[WithEditableTitle, WithEditableName]
[RestrictParents(typeof(ProductSection),typeof(ProductCategory))]
public class Product : ContentPageBase
{
}
}
News.cs (기본값)
using System.Web.UI.WebControls;
using N2.Definitions;
using N2.Details;
using N2.Integrity;
using N2.Templates.Mvc.Services;
using N2.Web.Mvc;
using N2.Persistence;
namespace N2.Templates.Mvc.Models.Pages
{
[PageDefinition("News", Description = "A news page.", SortOrder = 155,
IconUrl = "~/Content/Img/newspaper.png")]
[RestrictParents(typeof (NewsContainer))]
public class News : ContentPageBase, ISyndicatable
{
public News()
{
Visible = false;
Syndicate = true;
}
[EditableTextBox("Introduction", 90, ContainerName = Tabs.Content, TextMode = TextBoxMode.MultiLine, Rows = 4,
Columns = 80)]
public virtual string Introduction
{
get { return (string) (GetDetail("Introduction") ?? string.Empty); }
set { SetDetail("Introduction", value, string.Empty); }
}
string ISyndicatable.Summary
{
get { return Introduction; }
}
[Persistable(PersistAs = PropertyPersistenceLocation.Detail)]
public virtual bool Syndicate { get; set; }
}
}
네가 맞아, 나는 그들을 N2 장소로 만든 제품에 다시 지정했다. 감사! – Ropstah