Custom field in module

Posted by Community Admin on 05-Aug-2018 13:50

Custom field in module

All Replies

Posted by Community Admin on 20-Apr-2011 00:00

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

Posted by Community Admin on 20-Apr-2011 00:00

Hello Higgsy,

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

Cheers,
Duneel

This thread is closed