Attach a file to a news item

Posted by Community Admin on 04-Aug-2018 22:51

Attach a file to a news item

All Replies

Posted by Community Admin on 16-Nov-2011 00:00

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!

Posted by Community Admin on 17-Nov-2011 00:00

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

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 Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 17-Nov-2011 00:00

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?

Posted by Community Admin on 17-Nov-2011 00:00

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

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 Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 17-Nov-2011 00:00

Alex,

To clarify, the Document Manager link isn't immediately visible when creating a new news item. Clicking on "More formatting options" will toggle the advanced toolbars. The icon is located there.

Hope this helps!

Posted by Community Admin on 17-Nov-2011 00:00

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?

Posted by Community Admin on 17-Nov-2011 00:00

Alex,

Absolutely! Check out this blog post for details.

This thread is closed