Thumbnail field for custom content module

Posted by Community Admin on 03-Aug-2018 01:45

Thumbnail field for custom content module

All Replies

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

Hello,

I created custom content module regarding this post.
Now I'm trying to add field to my content module that would hold thumbnail.
I added thumbnail selector project from this post.
Now I'm trying to use this selector to add thumbnail field.

For custom content item I defined new field (+ all appropriate mappings for openaccess):

/// <summary>
/// item thumbnail
/// </summary>
[DataMember]
public string ItemThumbnail
    get return this.itemThumbnail;
    set this.itemThumbnail = value;

And in the ItemsDefinitions -> CreateBackendSections
I added thumbnail field like following:
// ItemThumbnail field
var itemThumbnailField = new Telerik.Sitefinity.Samples.SimpleImageFieldElement(mainSection.Fields)
    ID = "itemThumbnailFieldControl",
    DataFieldName = "ItemThumbnail",
    DisplayMode = displayMode,
    Title = "Item Thumbnail",
    CssClass = "sfTitleField",
    WrapperTag = HtmlTextWriterTag.Li
;
itemThumbnailField.ValidatorConfig = new ValidatorDefinitionElement(itemThumbnailField)
    Required = false
;
mainSection.Fields.Add(itemThumbnailField);

Please not that I used Telerik.Sitefinity.Samples.SimpleImageFieldElement from this post.
But some reason in the edit mode I see thumbnail field as a regular TextField not SimpleImageField.
Did I miss something?

PS: some reason in the FireFox sitefinity falls to the infinite page reload loop (usually when I create new items). I have to use IE. Is this known issue?

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

Yep, known issue, fixed in 4.2 Hotfix 1 and certainly in the new 4.2 SP1 (unless it's a new bug :)

Posted by Community Admin on 02-Oct-2011 00:00

I think I found solution. I just used ImageFieldElement.
This post is acually workaround for news content items. But if you create your own content module you have to use ImageFieldElement.

Steve, you are right, it was fixed in SP1!

This thread is closed