Liquid, JavaScript, themes, sales channels
Hello!
I'm looking to change the title and add a meta description for my collections/all page. Any advice? (currently using the minimal theme)
Thanks!
Solved! Go to the solution
This is an accepted solution.
Hi,
Thought this might be helpful for some of you. If you don't have an SEO plugin that handles it you can edit your theme.liquid file and add something like this:
{% comment %} Handle certain pages manually which aren't available in the backend such as all products {% endcomment %}
{%- if collection.title == 'Products' -%}
{% assign seo_title = "INSERT PAGE TITLE HERE" %}
{% assign page_description = "INSERT PAGE DESCRIPTION HERE" %}
{%- endif -%}
I added it right before the opening title tag so it would set those variables before the theme file requested them:
{% comment %} Handle certain pages manually which aren't available in the backend such as all products {% endcomment %}
{%- if collection.title == 'Products' -%}
{% assign seo_title = "INSERT PAGE TITLE HERE" %}
{% assign page_description = "INSERT PAGE DESCRIPTION HERE" %}
{%- endif -%}
<title>{{ seo_title | strip collection.title }}</title>
{%- if page_description -%}
<meta name="description" content="{{ page_description | escape }}">
{%- endif -%}
Hi,
you want to add in particular collection or all collection page, where the all collections there !
can you share the page url?
Looking to add in the all collections page, where all the products are listed.
Here is the url:
https://abcboutiquemedical.com/collections/all
This is an accepted solution.
Hi,
Thought this might be helpful for some of you. If you don't have an SEO plugin that handles it you can edit your theme.liquid file and add something like this:
{% comment %} Handle certain pages manually which aren't available in the backend such as all products {% endcomment %}
{%- if collection.title == 'Products' -%}
{% assign seo_title = "INSERT PAGE TITLE HERE" %}
{% assign page_description = "INSERT PAGE DESCRIPTION HERE" %}
{%- endif -%}
I added it right before the opening title tag so it would set those variables before the theme file requested them:
{% comment %} Handle certain pages manually which aren't available in the backend such as all products {% endcomment %}
{%- if collection.title == 'Products' -%}
{% assign seo_title = "INSERT PAGE TITLE HERE" %}
{% assign page_description = "INSERT PAGE DESCRIPTION HERE" %}
{%- endif -%}
<title>{{ seo_title | strip collection.title }}</title>
{%- if page_description -%}
<meta name="description" content="{{ page_description | escape }}">
{%- endif -%}
Actually, there is no need to do code modifications.
Shopify creates virtual collection with handle all which contains all products from your shop, but you can explicitly create collection with title all (so that it handle will be all) and this collection will be used instead.
You can create it as automatic collection with any broad condition, like "price > 0" or "product available", etc.
After collection is saved, you can then rename it (the handle will stay unchanged), add collection image and description, set sorting order and so on...
Yeah do Tim's one way easier.
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024