Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1323216
    Eric
    Participant

    Hey I’m trying to create a button on my portfolio item page that when clicked, will open up a PDF document (either in the browser or via download). Now I figured out how to do all that using this forum (https://community.theme.co/forums/topic/automatically-downloading-a-pdf-from-a-button/), which taught me how to link to a PDF using shortcodes.

    However what I can’t figure out is how to password protect one specific element on a page, which in this case would be the button that triggers my PDF download. Ideally when the button is clicked it should create a pop-up form requesting a password, and then once it’s entered, the download would begin (or the PDF would open within a new tab).

    Now within the forum I saw that this can be accomplished using a plugin (you guys linked someone to this website: https://www.tipsandtricks-hq.com/create-a-password-protected-download-file-6838). However, if possible, I’d really like to do this without a plugin, just because they’re already beginning to slow down my website.

    So if you can, please let me know if this is possible, and if it is, please tell me how I should go about doing this. If it’s not possible I would also appreciate any other suggestions that you might have.

    Thanks!

    #1323217
    Eric
    Participant
    This reply has been marked as private.
    #1323430
    Prasant Rai
    Moderator

    Hello Eric,

    Thanks for writing in!

    You will have to use plugins to password protect downloadable files. We recommend you to follow the steps mentioned on tipsandtricks-hq.com.

    You can walk-through our website performance optimization guide to speedup your website:

    https://community.theme.co/kb/performance/

    Thanks.

    #1324968
    Eric
    Participant

    Just out of curiosity how come this code wouldn’t work?

    [protect] Your Button Text [/protect]

    Shouldn’t this password protect the link for my download? Or is the [protect] [/protect] shortcode for something else?

    Let me know and thanks for your help.

    #1325141
    Christopher
    Moderator

    Hi there,

    I added following shortcode in ‘Protect’ element and it worked :

    [button type="real" shape="square" size="mini" href="#example" title="Example"]Square Button[/button]

    Hope it helps.

  • <script> jQuery(function($){ $("#no-reply-1323216 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>