N2 CMSで作業しています自分自身のコンテンツタイプProduct
を追加しています。 ProductクラスをContentPageBase
から派生させてコンテンツツリーに追加できます。ただし、アイテムを編集すると、フィールドが反転しているように見えます(Title
およびText
)。すべてのサンプル項目(例:News
)の場合は、Title
が常に先頭に表示されます。私はTABNAMEに設定することができContainerName
プロパティがあることを理解N2 cmsで項目を編集するときのフィールド配置ですか?
は、しかし、私はNews
クラスでTitle
またはText
のための任意のプロパティの上書きが表示されていないので、これはどのようにすることができますか?
編集ニュース項目
編集製品
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