Class ExampleProductNewsItem
- Namespace
- Dynamicweb.Examples.Items
- Assembly
- Dynamicweb.Examples.dll
[Inheritance]
[Item("Product news item", "The example of code-first item with inheritance")]
[AreaRule]
[StructureRule(new StructureContextType[] { StructureContextType.Pages })]
[ParentRule(new ParentRestrictionRule.ParentType[] { ParentRestrictionRule.ParentType.RootOfWebsite, ParentRestrictionRule.ParentType.RegularPage })]
[Category("Example")]
[Icon(KnownIcon.Message)]
[TitlePattern("Product news {{Title}}")]
public class ExampleProductNewsItem : ExampleNewsItem
- Inheritance
-
ExampleProductNewsItem
- Inherited Members
Properties
Comments
[Group("Product")]
[EditableList("Comments")]
public string Comments { get; set; }
Property Value
ProductImage
[Group("Product")]
[File("Product Image", "/Images/Products", "gif,jpg,png")]
public string ProductImage { get; set; }
Property Value
RelatedProducts
[Group("Product")]
[Field("Related products", typeof(CheckboxListEditor<string>))]
[OptionSql("SELECT TOP 10 ProductId, ProductName FROM EcomProducts WHERE ProductPrice > 1000", "ProductName", "ProductId")]
public IEnumerable<string> RelatedProducts { get; set; }
Property Value
RunExamples
[Group("Special")]
[Checkbox]
public bool RunExamples { get; set; }
Property Value
Methods
Save(ItemContext)
Saves the current item.
public override void Save(ItemContext context)
Parameters
context
ItemContext- Context of the current item.
Exceptions
- InvalidOperationException
- Cannot resolve the system name for the given item type.