Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hey all!
Currently in the process of updating my company's Dawn Theme to 10.0.0 (I know they are now on 11.0.0, but I started a little while ago, we have a lot of previous customisations and a new design for the site on top of that haha - I have checked the code for 11.0.0, and this is the same in there too) .
Just in the process of adding/removing stuff in the main-product.liquid section and came across the following:
{%- when 'title' -%}
<div class="product__title" {{ block.shopify_attributes }}>
<h1>{{ product.title | escape }}</h1>
<a href="{{ product.url }}" class="product__title">
<h2 class="h1">
{{ product.title | escape }}
</h2>
</a>
</div>
When looking on the site, the a tag is hidden with css display:none.
My question is - what is the purpose of this?
Why would you link to the page you are currently on? Why is there an h2 tag with an h1 class, that is all hidden?
Wary of getting rid of it if it serves a purpose, but I can't think of what the purpose would be haha.
Thanks in advance!
Solved! Go to the solution
This is an accepted solution.
Hey all,
Just in case anyone is looking this up in the future, I've figured this out haha.
The html from the product page is shown in the product's modal on the collection page. The second product title in the <a> tag is shown instead of the H1 on there - I assume for H hierarchy purposes and not having 21/31 H1s on the collection page from all the modals.
Also explains the <a> tag that links to the product's product page haha.
This is an accepted solution.
Hey all,
Just in case anyone is looking this up in the future, I've figured this out haha.
The html from the product page is shown in the product's modal on the collection page. The second product title in the <a> tag is shown instead of the H1 on there - I assume for H hierarchy purposes and not having 21/31 H1s on the collection page from all the modals.
Also explains the <a> tag that links to the product's product page haha.
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We 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, 2024