Link is downloading instead of opening page

Hello,

We have a page where people can open catalogs and when they click on the “Download” button it opens in a new page. I’m trying to edit the first button to link to a page on the site, but when I update it, the link downloads instead of opening in a new tab.

Catalog page: Catalogs & Flyers | Lucky Line Products
Page I’m trying to get “View Catalog” button to link to: Lucky Line Catalog – Lucky Line Products

I’ve tried putting the html link in the button, the page name in the button, seeing if I can put target= “blank” in the code, and nothing seems to be working and is the same on different browsers. It has worked before when linking to the catalog off-site, but we need it to link to a page on shopify now.

Is there a way I can get the page to open instead of downloading?

Thanks!

Also, our theme is Supply and you edit the buttons with the literature blocks through the theme

With HTML, non-shopify pages or in some shopify theme cases, there’s making sure there is no download HTML attribute
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/a#download
In some cases on shopify put the file in an <iframe> on a custom page, with or without the default layout ({% layout ‘none’ %} etc)

It does or, or did, or that’s what the goal is.

With shopify served pages and rendering..
non-image files in shopify can get served as download URLs.
Merchants can’t change this it as it’s at the HTTP-headers level from shopify servers.

Search existing knowledge https://community.shopify.com/search?q=link+open+pdf+not+download

e.g. https://stackoverflow.com/questions/28916092/open-the-file-instead-of-the-link-and-not-to-download

Hello @sdoug

Please see the shot

You have this download attribute in the anchor tag. Please remove it and it will work.

I can not find the Supply theme on the store so if you can give me access or files I can check the code.

Thanks

Hi,
Here is some code relating to the area. I’m not sure how else to share, sorry.

https://admin.shopify.com/store/luckyline/themes/42493182055?key=sections/literature-section.liquid:L2-216

It’s literally there on line 19 download attribute on the anchor tag in literature-section.liquid

I don’t speak code, paul, so even if it’s “literally there” I don’t know how to edit it without messing something else up, hence why I am on the help forum.

It’s not even about code it’s a literal string of text.
Either way we can’t edit it for you through a forum post, that’s work.

Jjust follow the guidance that’s been given to you out of courtesy.

Just backup the theme, and remove the target text from that file. e.g. download
If worried learn about rollbacks first.
Don’t over think it.

Hello @sdoug

As @PaulNewton said it is at 19th line of the code shot you gave.

Just remove that text and it will work.

If you can’t then give me your store collaboration access, then I will fix it for you. Give me your store URL and I will send the request. Then I will fix it.

If you think open post is not the place, then you can message me. Also, it may cost you some money if I do it for you. Just message me, and we will sort it out.

Removing the “download” tag makes the catalog appear at the top of the page now rather than going to it’s own page where it should be located. Not sure if there is different target text I can put there –I’m having our IT look into it, but will take a bit longer.