• Resolved johnegg

    (@johnegg)


    Hi guys

    Loving this plugin!

    My client wants to add the option to link directly to the download file (ie not download it) but open it in new browser window.

    How do I get the direct link to file using php tag?

    cheers
    john

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter johnegg

    (@johnegg)

    Sorry can you clarify, is that an addon or do you mean switch to using that plugin instead of download monitor completely?

    Thread Starter johnegg

    (@johnegg)

    Sorry I dont think you understood what I meant. I ned to get the php code to get to the file directly.

    For example If I need to get the file:

    https://dev.acleddata.com/download/2864/

    I want php code to dynamically find where that file is so when I click it, it opens in new window:

    https://dev.acleddata.com/wp-content/dlm_uploads/2017/11/filename.pdf

    Plugin Contributor Barry Kooij

    (@barrykooij)

    Hey,

    You can do this by checking the “Redirect to file” option in the download edit screen. If you want to links to open in a new window, you’ll have to edit the content template to add a target attribute to the <a> element. You can read more on overriding templates here: https://www.download-monitor.com/kb/overriding-content-templates/

    Kind Regards,

    Barry Kooij

    Thread Starter johnegg

    (@johnegg)

    Thanks Barry, but the client wants bot direct download button + the open in browser option. I just cant figure out the php code to find the dynamic link to each pdf. Any ideas?

    Plugin Contributor Barry Kooij

    (@barrykooij)

    So you’re looking into custom coding this? If so, it might be worth waiting for the 4.0 release which is planned to be released ~mid December. Not only will custom development be a lot easier in the next version, it will also changes some things. So this will save you having to update it again in a couple of weeks.

    If you’re interested in joining the Beta program, you can sign up here: https://goo.gl/forms/yBIPieQnzSgy5Jbh2

    Kind Regards,

    Barry Kooij

    Thread Starter johnegg

    (@johnegg)

    Thanks Barry, well not really editing core files. I managed to edit my own template tp use so I can add whatever php I want in there. So i could have the link to download the pdf + view in browser in that template. Im just not sure how to link to teh pdf to open it in the browser.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Direct link to file’ is closed to new replies.