Dawn Theme 10.0.0 - Product Page - Reason for a tag to same page?

Solved
RhiRo
Shopify Partner
40 3 4

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.
Screenshot 2023-09-06 at 09.41.45.png


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! 

Accepted Solution (1)
RhiRo
Shopify Partner
40 3 4

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. 

View solution in original post

Reply 1 (1)
RhiRo
Shopify Partner
40 3 4

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.