More in this section

Forums / General Discussions / Thumbnail field for custom content module

Thumbnail field for custom content module

3 posts, 0 answered
  1. Denis
    Denis avatar
    105 posts
    Registered:
    27 Feb 2009
    29 Sep 2011
    Link to this post
    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?
  2. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    29 Sep 2011
    Link to this post
    Yep, known issue, fixed in 4.2 Hotfix 1 and certainly in the new 4.2 SP1 (unless it's a new bug :)
  3. Denis
    Denis avatar
    105 posts
    Registered:
    27 Feb 2009
    02 Oct 2011
    Link to this post
    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!
3 posts, 0 answered