More in this section

Forums / Developing with Sitefinity / Mapping News Item with a document in the Documents Library

Mapping News Item with a document in the Documents Library

5 posts, 0 answered
  1. Saumitra
    Saumitra avatar
    127 posts
    Registered:
    10 Mar 2009
    17 May 2010
    Link to this post
    Hi,

    I've a requirement where I need to display a file download link in the newsview control, just below the news summary. The link should download the document from the documents library and I should be able to map that document somehow to that particular news item. The reason I need to do this is:

    1. I want the summary content and the Title to be indexed for searching.
    2. I want every news item to necessarily have a document attached available for download (that would come from the documents library).

    Please suggest how do I take it up with Sitefinity 3.7.

    Thanks,
    Saumitra
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    17 May 2010
    Link to this post
    Hi Saumitra,

    Create a new metakey for your news items that will be used to set the path to your item from Images and Documents library of from the files system. You could use ButtonSelector - just copy paste the ButtonSelector code from NewsItemEdit and NewsItemNew templates.
    You can gather more information at our UserManual , section Adding Custom Fields and How to map a template

    All the best,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Saumitra
    Saumitra avatar
    127 posts
    Registered:
    10 Mar 2009
    17 May 2010
    Link to this post
    Hi Ivan,

    What I'm trying to figure out is that even though I'm able to map the news item with a document, how do I achieve the download functionality of Images and documents library in the newsview template ? To make it simpler, how do I ensure that the download link displayed in the newsview template automatically downloads the document as the ListViewTemplate for the library module does ?

    Thanks,
    Saumitra
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    17 May 2010
    Link to this post
    Hi Saumitra,

    If a download query string is added to the link of a file in a library, and is set to true, the file will be directly accessed for download. If false (as is by default), the file will be opened for viewing instead.

    Example:

    http://www.my_domain.com/MyFile.sflb?download=true 


    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  5. Saumitra
    Saumitra avatar
    127 posts
    Registered:
    10 Mar 2009
    17 May 2010
    Link to this post
    Hi Ivan,

    That worked perfect ! Thanks for the solution.

    Saumitra
Register for webinar
5 posts, 0 answered