Sitefinity Custom Module and the MultiImageFieldElement

Posted by Community Admin on 04-Aug-2018 22:54

Sitefinity Custom Module and the MultiImageFieldElement

All Replies

Posted by Community Admin on 12-Sep-2011 00:00

What is the datatype used for the MultiImageFieldElement?  I have the control showing up in the module's edit page, but I can't find what the data type is supposed to be used in the ViewModel or the FluentMappings; I keep getting various casting errors.

This is what I have so far:

Definition: (Works)
            MultiImageFieldElement imageField = new MultiImageFieldElement(mainSection.Fields)
           
                ID = "imageFieldControl",
                DataFieldName = "Images",
                DisplayMode = displayMode,
                Title = "Images",
                CssClass = "sfFormSeparator sfImageField",
                WrapperTag = HtmlTextWriterTag.Li,
                
            ;
            mainSection.Fields.Add(imageField);



ViewModel: (I also tried string)
        [DataMember]
        public ImageViewModel Images get; set;


FluentMapping:
            itemMapping.HasProperty(p => p.Images).HasColumnType("varchar(max)");

Posted by Community Admin on 16-Sep-2011 00:00

Hi Patrick Herrington,

If talking about eCommerce,

You can use have the model as below.

[DataMember]
        public List<ProductImage> Images
        
            get return images ?? (images = new List<ProductImage>());
            set images = value;
        

And the fluent mappings are done with LibrariesFluentMapping.

But I am not sure if the question is specific to eCommerce.

Greetings,
Radoslav Georgiev
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed