How to force a PDF file to open in a new tab?

Topic summary

A user needed help making a PDF file open in a new browser tab when clicked from a button on their ‘About’ page. They knew the target="_blank" attribute was required but didn’t know how to apply it to a specific button in their store’s code.

Resolution:

  • The user shared their store URL (atmos.art/pages/about) and collaborator access code
  • A developer accepted collaborator access to directly modify the code
  • The solution involved adding target="_blank" to the button element in the theme code
  • The fix was successfully implemented within approximately 10 minutes

Status: Resolved. The PDF now opens in a new tab as intended.

Summarized with AI on October 23. AI used: claude-sonnet-4-5-20250929.

Hi all,

I would like to force a PDF file to open in a new tab by default when clicked on my ‘About’ page. I have read that his code can achieve this but I don’t know how to make it target just a single button.

target=”_blank”

How can I achieve this?

Website URL: About – Atmos Art

Thanks

1 Like

Hi @atmos-art

Ok dear, please share your store URL and collaborator code with me so I can check and provide you with the proper solution.

Hi, my collaborator code is 0051

The URL is About – Atmos Art

URL is www.atmos.art/pages/about

1 Like

Hi @atmos-art

I’ve sent you the request — please accept it.

Blockquote

Hi, I have accepted your request. I would prefer to communicate here instead please.

1 Like

I forgot to mention that the file I am referring to is linked to a button at the bottom of my ‘About’ page.

1 Like

Customize the button in the section using code, then add target=“_blank” to it. Of course, you can activate this for each button at any time.

It only takes us 10 minutes. Feel free to contact us.

Hi @atmos-art

Okay, I’m checking.

Hi, I don’t know what the correct code is/how to add target=“_blank” to this specific button. I’m not sure which file in the code I would find this button ID in either.

Hi @atmos-art

Please check and let me know if it’s working properly.

1 Like

Hi, that seemed to do the trick. Many thanks!

1 Like

Hi @atmos-art

Thank you for your response. It’s good to know that it’s worked for you. Kindly feel free to get back to me if you need any further assistance. If helpful, please like all posts. :white_check_mark:

Best regards,
Devcoder :laptop:

1 Like