More in this section

Forums / Developing with Sitefinity / Attach a file to a news item

Attach a file to a news item

7 posts, 0 answered
  1. Alex
    Alex avatar
    39 posts
    Registered:
    19 Jul 2010
    16 Nov 2011
    Link to this post
    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!
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    17 Nov 2011
    Link to this post
    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
  3. Alex
    Alex avatar
    39 posts
    Registered:
    19 Jul 2010
    17 Nov 2011
    Link to this post
    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?
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    17 Nov 2011
    Link to this post
    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
  5. Tim
    Tim avatar
    258 posts
    Registered:
    22 Jun 2011
    17 Nov 2011
    Link to this post
    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!
  6. Alex
    Alex avatar
    39 posts
    Registered:
    19 Jul 2010
    17 Nov 2011
    Link to this post
    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?
  7. Tim
    Tim avatar
    258 posts
    Registered:
    22 Jun 2011
    17 Nov 2011
    Link to this post
    Alex,

    Absolutely! Check out this blog post for details.
7 posts, 0 answered