I’m using the Refresh theme. On my shop I have a default product page. I added a code snippet for a back button and referenced this in the main theme layout file. Everything worked. Then I created a second product page template so I could customize further. This new template isn’t showing the back button.
I assumed that the new template would also use the main theme layout so the button would just appear. Should a new page template automatically use the main theme layout? If so, shouldn’t it automatically know about the same code snippets?
I don’t see any sort of liquid file for the new template, only a json file. So, if I need to add the snippet again or reference it somewhere, I’m not sure where. Basically, how do I get the new product page template to reference the same code snippet and display the same back button as the default page?
Hello @ADHD
Thank you for submitting your query to the Shopify community. I’d be happy to assist you. Could you please provide the store URL and password (if it’s password-protected) so I can review and get back to you with an update?
If your code in layouts/theme.liquid is like this:
or
```php
Then it should be visible on all pages and all templates on your site.
However, if you have a condition in your snippet like (which you seem to have, because /collections does not have back button)
```php
{% if template == "product" or template == "collection" %}
then obviously this is the reason why it does not show on new product template.
The code should be
{% if template.name == "product" or template.name == "collection" %}