How to change Dawn theme All Product Page title

How to change Dawn theme All Product Page title

_Thomas_
Visitor
1 0 2

Hello,

 

I would like to change the Title on my All Products Page.  Currently it is set to "Products" and it appears I am unable to change it without editing code.  I found the code below, in "Theme.liquid".  Can someone tell me where the All Products Page "collection.title" value is located?

 

 

      <h1 class="collection-hero__title">
        <span class="visually-hidden">{{ 'sections.collection_template.title' | t }}: </span>
          {{- collection.title | escape -}}
      </h1>

 

I tried changing it to "Something Else", which worked...however "Something Else" also displayed on my Collection page H1 titles.

 

      <h1 class="collection-hero__title">
        <span class="visually-hidden">{{ 'sections.collection_template.title' | t }}: </span>
          Something Else
      </h1>

 

Any suggestions are appreciated.

 

Thanks in advance,

Thomas

Replies 2 (2)

brs976
Visitor
2 0 0

Sme here. I am looking for the same solution to change "Products" word to something else.
I found this with CSS selector but couldn't find the source code. 

<h1 class="collection-hero__title">
<span class="visually-hidden">Collection: </span>Products</h1>

If any one know where can we find the source code to change this "product" word, it will be highly appricated.

aGrouse
Visitor
1 0 0
  • Go to customize your template
  • Find the file main-collection-banner.liquid
  • Find the line with the code (most likely line 17) 

 

 

{{- collection.title | escape -}}​​

 

 

  • Replace this line with this code

 

 

{% assign current_title = collection.title %}
{% if canonical_url contains '/collections/all' %}
  {% assign current_title = 'All Products' %}
{% endif %}
{{- current_title | escape -}}​

 

 

  • Replace 'All Products' with whatever you want

Of course, do not forget that if you use several languages ​​on your site, you need to add translation strings to the files that correspond to your languages ​​in the system.
For example, if your site is presented in two languages ​​(English / Spanish), you can do this:

  • in the locales/en.default.json file in sections->collection_template add 

 

"all_products_title": "All products (or whatever you want)"​

 

  • and do the same in the locales/es.json file, but add 

 

"all_products_title": "Todos los productos (or whatever you want in Spanish)"​

 

  • after that, replace 'All products' in main-collection-banner.liquid with 

 

'sections.collection_template.all_products_title' | t​