ExtendingNews Module to contain a Document

Posted by Community Admin on 04-Aug-2018 10:18

ExtendingNews Module to contain a Document

All Replies

Posted by Community Admin on 22-Feb-2014 00:00

Hey forumsters,
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!!
Regards,
Kris

Posted by Community Admin on 26-Feb-2014 00:00

Hi,

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.

Regards,
Sabrie Nedzhip
Telerik

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

This thread is closed