I have just a quick, hopefully easily answered question.
How would one go about when wanting to add a custom field to the news module which allows to select a document?
My first thought was to use a custom control which derives from an assetsfield, configuring it to to write mode and single-document. Andadding that as custom field, with short-text by specifying the complete typestring. That seems to work in so far, as the document selector link is available in the edit news item backend and it allows me to choose or upload a document. The problem being it does not save the choose document to the underlying custom field. So when opening the News-Item again, after publishing, the custom field is still empty. When inspecting the generated PUT-Request the custom field contains an empty string.
Is it possible to use the asset field in write-mode to fill a custom field on the news (or event) module, or do I have to build my widget with designer and everything?
Thank you for your support!!
Posted by Community Admin on 26-Feb-2014 00:00
The AssetsField works only for modules created with the Module Builder and this might be the reason why you experience issues with it. You can take a look at the following documentation article which is for creating an image selector for content items. You can use the sample there as a base which you can further modify and improve in order to achieve the functionality you desire.
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 Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items