Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1312154
    peyton_dcosta
    Participant

    Hey X team,

    If you go down to the promote section of my site: http://www.lift-jesus-higher-rally.ca and click on the promote section text it opens a lightbox post which contains three icons. These icons are supposed to be download links to .pdf files.

    The issue is, when I click on them, nothing happens. The code I used is

    <a href=”http://www.lift-jesus-higher-rally.ca/wp-content/uploads/2017/01/LJH-full-page-flyer-2017_final.pdf&#8221; target=”_blank” title=”Adult Poster” style=”color:#cfb53b;”
    >[x_icon type=”file-pdf-o”]

    Wondering if you can point out my mistake. All I need is for it to download, either automatically or a online pdf where they can then download. Thank you.

    #1312232
    Christopher
    Moderator

    Hi there,

    You missed the closing tag, it should be :

    <a href="http://www.lift-jesus-higher-rally.ca/wp-content/uploads/2017/01/LJH-full-page-flyer-2017_final.pdf" target="_blank" title="Adult Poster" style="color:#cfb53b;">[x_icon type="file-pdf-o"]</a>

    Hope it helps.

    #1313607
    peyton_dcosta
    Participant

    Hey Chris,

    Sorry I forgot to put the code in here but I do actually have the closing tag in my website. Here is the full code that I have in the website:

    <a href=”http://www.lift-jesus-higher-rally.ca/wp-content/uploads/2017/01/LJH-full-page-flyer-2017_final.pdf&#8221; target=”_blank” title=”Adult Poster” style=”color:#cfb53b;”
    >[x_icon type=”file-pdf-o”]

    but it still does not do what I need it to do. All I need is for it to download, either automatically or a online pdf where they can then download. Thank you.

    #1313766
    Paul R
    Moderator

    Hi,

    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    #1313778
    Friech
    Moderator

    Hi There,

    Add an ID to your anchor tag.

    e.g
    <a id="forcedownload" href="http://www.lift-jesus-higher-rally.ca/wp-content/uploads/2017/01/LJH-full-page-flyer-2017_final.pdf" target="_blank" title="Adult Poster" style="color:#cfb53b;">

    And then add this on Customizer > Custom > Global JavaScript

    jQuery( document ).ready(function($) {
    	$( "#forcedownload" ).attr( "download", "" );
    });

    Keep in mind that not all browsers support the download attribute, so the best way to force download is to zip your file instead.

    Hope it helps, Cheers!

    #1314586
    peyton_dcosta
    Participant
    This reply has been marked as private.
    #1314921
    Friech
    Moderator

    Hi There,

    Sorry my anchor code above is incomplete, this is the correct code.

    <a href="http://www.lift-jesus-higher-rally.ca/wp-content/uploads/2017/01/LJH-full-page-flyer-2017_final.pdf" target="_blank" title="Adult Poster" style="color:#cfb53b;" download>this is a link</a>

    You can disregard the JavaScript I’ve provided.

    all I need is for the download to be able to open to a new pdf page where the person downloading the file can then save it or print it.

    Most of the latest browser’s behaves that way, it open the .pdf file link to a new window for the users to view or download. If not, it will download the pdf file automatically. It is really a browser’s settings.

    Please refer to this draft page and see which link fits on your needs.

    Hope it helps, Cheers!

    #1315102
    peyton_dcosta
    Participant

    Hey Friech,

    Thank you for the code. While I see it working on your draft page with the text links, it doesn’t work in my promote section. If you go to the website and to the section “Promote” on the main page, click on it and it will open a lightbox with content from the promote post in there. It is here I have the link.

    If you click on the link (the Adult poster icon) you will see nothing happens. I have your code in there.

    Hope you can help with another solution.

    Thank you and sorry for the trouble.

    #1315341
    Christopher
    Moderator

    Hi there,

    The page displays ‘Youth’ grid, Youth grid supposed to display post with slug example.com/youth but the post is empty, see http://www.lift-jesus-higher-rally.ca/youth/.

    Let us know where we can see the item?

    Thanks.

    #1316168
    peyton_dcosta
    Participant

    Hey Chris, on the home page, if you scroll to the bottom there is a section called “Promote”. If you click on the text there, it opens an lighbox section with more on promote. The downloadable content is in this section. It is here that the download will not download on click.

    I have attached a screen shot for your convenience.

    Thank you for your help.

    #1316185
    peyton_dcosta
    Participant

    Hey I didn’t realize what link you were looking at but you have to click on the ‘Promote’ section of the main page of my website to see that the download doesn’t work. If you go from the back end ie. through the promote post, the link works.

    However it does not work when trying to download through the main page of my website. Please check it via the main page of the website.

    #1316833
    Rue Nel
    Moderator

    Hello There,

    I have carefully investigated the issue and it turns out that Essential grid is preventing any of the clicks. This is the reason why the download link is not working. To resolve this, you need to update your download link code and use this instead:

    
    <a class="forcedownload" href="http://www.lift-jesus-higher-rally.ca/wp-content/uploads/2017/01/LJH-full-page-flyer-2017_final.pdf" target="_blank" title="Adult Poster" style="color:#cfb53b;" download>[x_icon type="file-pdf-o"]</a>

    And then you’ll need to add this JS code in the customizer, Appearance > Customize > Custom > JS

    jQuery( document ).ready(function($) {
    	$( "body .forcedownload" ).on('click', function(){
          var link = $(this).attr('href');
          window.open(link, 'window name', 'window settings');
          console.log(link);
          return false;
        });
    });

    We would loved to know if this has work for you. Thank you.

    #1317501
    peyton_dcosta
    Participant

    Hey Rue Nel,

    Happy New Year!
    Thank you for the code but, it does not work. If you have any other suggestions…I am all ears.

    Thank you again for looking into it for me.

    #1318174
    Rue Nel
    Moderator

    Hello There,

    Sorry if the code doesn’t work out. It seems that all the mouse clicks were captured by Essential grid and that’s why the code did not work. One last resort to be able to force the link to be open in a new window. Please remove the JS code we gave you. And then have your html content updated and use this instead:

    
    <a onclick="javascript: window.open('http://www.lift-jesus-higher-rally.ca/wp-content/uploads/2017/01/LJH-full-page-flyer-2017_final.pdf', 'window name', 'window settings');" class="forcedownload" href="http://www.lift-jesus-higher-rally.ca/wp-content/uploads/2017/01/LJH-full-page-flyer-2017_final.pdf" target="_blank" title="Adult Poster" style="color:#cfb53b;" download>[x_icon type="file-pdf-o"]</a>

    Hope this helps.

    #1318442
    peyton_dcosta
    Participant

    Rue Nel,

    You are bloody amazing!!!!!! I could hug you right now. IT WORKS!!!

    THANK YOU soooooooooo much!!!

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