+1-888-365-2779
Try Now
More in this section

Forums / Suggestions / download=true

download=true

3 posts, 0 answered
  1. Darren
    Darren avatar
    72 posts
    Registered:
    19 Mar 2008
    01 Jul 2008
    Link to this post
    When adding a new document through the rad editor, it would be useful to be able to indicate whether to add 'download=true' to the link without having to switch to the HTML view.
    While I don't mind making the modification myself through the HTML view I've had clients ask if this can be done without resorting to editing in HTML.
  2. Darren
    Darren avatar
    72 posts
    Registered:
    19 Mar 2008
    01 Jul 2008
    Link to this post
    Incidentally, this stemmed from an issue I'm investigating in a particular site where theres links to .sflb documents in a news article which are not being mapped back to the original .doc or .pdf documents.
    All images in image libraries are working fine but the only way I can get the documents to work without using the document library controls is to edit the link and add ?download=true on the end.


    Do you have any idea whether theres some way to allow documents to be added through the rad editor from a document library and downloaded/opened without making this amend to the link?

    Thanks

  3. Vassil Daskalov
    Vassil Daskalov avatar
    261 posts
    Registered:
    18 May 2013
    04 Jul 2008
    Link to this post
    Hi Darren,

    Actually, you could achieve this behavior pretty easily. You should open the ~/Sitefinity/Admin/ControlTemplates/Libraries/Dialogs/DocumentEditorDialog.ascx file and in the editHolder Panel, add a checkbox input which would determine whether the file will be downloadable:

    <span>Make it downloadable:</span> 
    <input type="checkbox" id="downloadble" /> 

    After that, in the same file, you will need to modify the insertLink function, by finding the checkbox added previously and add to the document url the download=true query string if checked:

    downloadble = document.getElementById('downloadble');  
     
    if (downloadble.checked)  
            closeArgument.href = selValue.value + '?download=true';  
       else 
            closeArgument.href = selValue.value; 

    This should do the trick. Hope it helps.

    Greetings,
    Vassil Daskalov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Register for webinar
3 posts, 0 answered