Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

New Post: Optional Image and Page Field on Custom Data Type

$
0
0
And for completeness, here is the resulting Data-Type (added IGenericSortable from the Package Contribution.CompositeC1Contrib.Sorting, https://compositec1contrib.codeplex.com/SourceControl/latest#Sorting/Package/, this is not required):
[AutoUpdateble]
[DataScope(DataScopeIdentifier.PublicName)]
[DataAncestorProvider(typeof(NoAncestorDataAncestorProvider))]
[PublishProcessControllerType(typeof(GenericPublishProcessController))]
[ImmutableTypeId("{305AFF70-A88A-476F-B4BC-F4251BBB2803}")]
[Title("ListDataEntry")]
[LabelPropertyName("Title")]
publicinterface IListDataEntry : IPageFolderData, IPublishControlled, ILocalizedControlled, IGenericSortable
{
    [StoreFieldType(PhysicalStoreFieldType.String, 249)]
    [ImmutableFieldId("{BD4865BD-550C-475E-80C9-3687649991A5}")]
    string Title { get; set; }

    [StoreFieldType(PhysicalStoreFieldType.LargeString)]
    [ImmutableFieldId("{EF9E6D48-0E46-4BE7-8520-289C66522568}")]
    string Text { get; set; }

    [StoreFieldType(PhysicalStoreFieldType.String, 2048, IsNullable = true)]
    [ImmutableFieldId("{404CF161-FE53-4C8D-B244-2AA4658ED1EE}")]
    [ForeignKey(typeof(IImageFile), "KeyPath", AllowCascadeDeletes = false, NullReferenceValue = null, NullReferenceValueType = typeof(string))]
    string BackgroundImageUrl { get; set; }

    [StoreFieldType(PhysicalStoreFieldType.String, 2048, IsNullable = true)]
    [ImmutableFieldId("{1AA8A90A-7F85-4462-908D-A13CD219AB60}")]
    [ForeignKey(typeof(IImageFile), "KeyPath", AllowCascadeDeletes = false, NullReferenceValue = null, NullReferenceValueType = typeof(string))]
    string SmallImageUrl { get; set; }

    [StoreFieldType(PhysicalStoreFieldType.Guid, IsNullable = true)]
    [ImmutableFieldId("{76BC51BE-A989-41AD-AD5D-DCBC09C8D597}")]
    [ForeignKey(typeof(IPage), "Id", AllowCascadeDeletes = false, NullReferenceValue = null, NullReferenceValueType = typeof(IPage))]
    Guid? ReadMorePage { get; set; }
}

Viewing all articles
Browse latest Browse all 2540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>