Hi,
I have searched the forum and found this question asked in several different ways, but never found a solution on any of the threads.
Hi,
I am trying to change the meta title and meta description on my main collections page (Collections ) – without changing anything on the homepage or any other collection.
Using Shopify 2.0 Prestige Theme
Any ideas?
Thanks,
Afwan
Hi @afwanfhaider ,
You can try using liquid code to check /collections
{% if template == 'list-collections' %}
{% else %}
{% endif %}
Hope my solution works perfectly for you!
Best regards,
Oliver | PageFly
Webmit
May 18, 2024, 10:34am
3
Hi Afwan -
I had the same issue and I found this discussion that had several solutions.
https://community.shopify.com/post/1776435
I have implemented the following on my website using the Expanse theme from Shqipdonselmani
Check your theme for the correct reference to the collections list in your theme and modify it if needed to match your template name.
Hello guys,
I came up with a way around and a good solution
Add this code to settings_schema.json file
{
“name”: “Collections Meta”,
“settings”: [
{
“type”: “text”,
“label”: “Meta Description”,
“id”: “metadescriptioncollections”
}
]
},
It will create a section to the THEME SETTINGS for you to change it
And then on the theme.liquid file change this
{% if page_description %}
{% endif %}
to this
{%- if page_description -%}
{% if template == ‘list-collections ’ %}
{% else %}
{%- endif -%}
{%- endif -%}
In this way we will be able to dynamically change the meta description for the collection page all the time without touching the code anymore