Shopify themes, liquid, logos, and UX
Good morning,
I've been working on applying the Dawn theme to our website at JapanimeGames.com and for the most part, it's either just what we need, or modify-able enough that I can work around it. However, although my simple code snippet forwards collections on our current theme, it isn't working in Dawn. Several of our 'collections' only have one item in them and we'd like our front-page tile to point to the product instead of the collection page. We've tried the work-arounds for using a re-direct, but those don't work, so I added:
<meta http-equiv="refresh" content="0; url = '/products/the-tree-lined-avenue"><br>Just one product in this collection, we're taking you there now!
to the HTML section of those collections and would love it if I could get it to work with Dawn. The preview link for the theme is Japanime Games - any suggestions?
TIA for any help!
Morning @Heather_P , Several issues,
Reproducibility - When seeking resource specific help provide links to specific examples for other people for each relevant step. resource = product,collection,page,etc
You've linked to a product url but not a collection url which is the focus of the problem so no one has anything to inspect for reproducing the issue.
Syntax - in the meta tag example you provided it looks like you've mixed quotes and apostrophes
<meta http-equiv="refresh" content="0; url = '/products/the-tree-lined-avenue"><br>Just one product in this collection, we're taking you there now!
<meta http-equiv="refresh" content="0; url=/products/the-tree-lined-avenue">
Invalid Html -
Avoid putting meta tags in the <body> of a document while allowed in HTML5 this is really meant for microdata and not things like meta refreshes which should be kept in the head.
If this is in the <head> of the theme then the text in your sample code needs to be (re)moved as it should only exist inside the <body> and then inside a block element <div> ,etc or a text element <h2>,<p> ,etc.
Approach -
This is a band-aid for an open wound, when there is only 1 product in the collection if the intent is that collection should be ignored then you should be changing all such links that point to those collections to be the url of the product instead.
Then on the collection pages make the choice for a canonical rel attribute pointing to the product while it only has 1 product.
At minimum once you figure out how to have the meta redirect working that too should have logic so it only ever applies when a single product is a collection. Otherwise these types of things tend to get forgotten and will create an invisible user frustration the business becomes oblivious too.
Save time & money ,Ask Questions The Smart Way
Confused? Busy? Get the solution you need paull.newton+shopifyforum@gmail.com
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Buy Paul a ☕ Coffee for more answers or donate to eff.org
I would love to link directly to the product, rather than the collection, but that's not available on the front page 'collection' list for Dawn. Our upper navigation menu where I can point direct does that, however.
Thank you for pointing out the single versus double quote, though. Apparently I am getting cross-eyed staring at stuff!
We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024The Hydrogen Visual Editor is now available to merchants in Shopify Editions | Summer '...
By JasonH Sep 2, 2024