Attach a file to a news item
When creating a news item I would like to be able to upload pdf and a word document files to then display download links to those files on the frontend. I know I can add custom data fields to the news module, but how would I then upload a document that could then be updated and be related to this particular news item.
I currently just have a text box data field that I paste a url to that specific file, but I really don't want to separate the steps.
Thanks!
Hello Alex,
You can insert document links directly in the body of your news item. This does not require custom development and you only have to work with the built-in UI. If you want to do it with a custom field, you should add a filed that has a content selector that lists all documents you have and then render the custom field value as hyperlink. Actually don't see what would be the difference if the purpose is only to have a download link. The second approach is useful if you want to get/set some value of the custom field programmatically for another implementation and adding the field is just part of a bigger task.
Greetings,
Ivan Dimitrov
the Telerik team
Here is the scenario. A news item will have word document and pdf files associated with it which will be stored within the CMS. I do not want the person adding the news item to have to go to the documents library upload those files there then go to create the news item and paste in the url for the 2 files. I want to streamline this process so he can do it all from the "Create News Item" screen.
Does this make sense?
Would implementing it as a custom field with a content selector mean that I would have to create an ascx that returns a dropdown where they select the document?
Hello Alex,
1. If you add a link through the news item content you don't have to paste anything
2. If you have a custom field with a selector you also don't have to paste anything.
In both cases you need to upload an item and create a news item.
As for the actual implementation, I would proceed with some more user friendly dialog than drop down. Something like a dialog with RadListView that shows names, images etc.
Regards,
Ivan Dimitrov
the Telerik team
Thanks! That was where the disconnect was. I didn't see where I could do that. Is there settings to make that either default to open up or show the document manager in the shorter list?
Alex,
Absolutely! Check out this blog post for details.