+1-888-365-2779
Try Now
More in this section

Forums / Sitefinity SDK / Custom field in module

Custom field in module

2 posts, 0 answered
  1. higgsy
    higgsy avatar
    336 posts
    Registered:
    05 Aug 2010
    20 Apr 2011
    Link to this post
    Hi,

    I've just been through the Creating image selector for the news module blog, and have the selector working in the news module. I want to reuse this field on a custom module, but a custom module doesn't even have the link in the sidebar for "Custom fields". From looking at the latest products module it looks like the SimpleImageField has been coded into the module (see code example below), however this doesn't allow me to add fields to my custom modules at a later date per project.

    var thumbnailField = new SimpleImageFieldElement(mainSection.Fields)
    {
        ID = "thumbnailFieldControl",
        FieldName = "ThumbUrl",
        DataFieldName = "ThumbUrl",
        FieldType = typeof(SimpleImageField),
        DisplayMode = displayMode,
        Title = "Thumbnail",
        CssClass = "sfTitleField",
        ResourceClassId = typeof(ProductsResources).Name
    };
    mainSection.Fields.Add(thumbnailField);

    Is this something that is fixed in the latest release>? Or will I always have to hard code fields into my modules?

    Thanks
    higgsy
  2. Duneel
    Duneel avatar
    166 posts
    Registered:
    08 Dec 2010
    20 Apr 2011
    Link to this post
    Hello Higgsy,

    Please refer to this post to have Custom Fields option in custom modules.

    Cheers,
    Duneel
2 posts, 0 answered