Hiding the collection description on collection page Debut Theme

Solved
Highlighted
Shopify Partner
14 0 2

So I need to hide the collection description (not the title) in my collection pages. I know I can leave the description blank in Shopify, but I wanted to see if it is possible to hide because I'm using an automated SEO app that uses the description as SEO tags. Thanks! 

0 Likes
Astronaut
884 106 197

You can hide it by going into your collection.liquid, ctrl + f for {{ collection.description }} -- And comment it out:

 

{% comment %}
{{ collection.description }}
{% endcomment %}

If you open collection.liquid and see something like:

 

{% section 'collection-template' %}

//or 

{% include 'collection-template' %}

 

You will want to find those files and search for collection.description and do what I mentioned earlier. If you see "section" it's a section file, if you see "include" it's a Snippet file.

If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
0 Likes
Shopify Partner
14 0 2

Hi! Thanks for the reply. I can't find the collection.description line neither in collection.liquid (section file) nor collection.liquid (template file). The only place I can find it is in collectio-template.liquid but it is inside an IF statement:

      {% if collection.description != blank %}
        <div class="rte collection-description page-width">
          {{ collection.description }}
        </div>
      {% endif %}
    {% else %}
      <div class="page-width">
        <div class="section-header text-center">
          <h1>{{ collection.title }}</h1>
          {% if collection.description != blank %}
            <div class="rte">
              {{ collection.description }}
            </div>
          {% endif %}

Maybe it's here that I have to make the changes? Or maybe I can code in the theme.css.liquid file? 

0 Likes

Success.

Tourist
13 1 2

@Jose13 wrote:

Hi! Thanks for the reply. I can't find the collection.description line neither in collection.liquid (section file) nor collection.liquid (template file). The only place I can find it is in collectio-template.liquid but it is inside an IF statement:

      {% if collection.description != blank %}
        <div class="rte collection-description page-width">
          {{ collection.description }}
        </div>
      {% endif %}
    {% else %}
      <div class="page-width">
        <div class="section-header text-center">
          <h1>{{ collection.title }}</h1>
          {% if collection.description != blank %}
            <div class="rte">
              {{ collection.description }}
            </div>
          {% endif %}

Maybe it's here that I have to make the changes? Or maybe I can code in the theme.css.liquid file? 


If you don't need the collection.description then you can comment it out like below. Although I recommend refactoring the block so you don't have unnecessary conditions (if/else) and just render the collection.titles.

 

{% if collection.description != blank %}
        <div class="rte collection-description page-width">
{% comment %} {{ collection.description }}
{% endcomment %} </div> {% endif %} {% else %} <div class="page-width"> <div class="section-header text-center"> <h1>{{ collection.title }}</h1> {% comment %} {% if collection.description != blank %} <div class="rte"> {{ collection.description }} </div> {% endif %} {% endcomment %}

 

Need shopify help? Drop us an email hi@cnvs.la
Web: www.cnvs.la
1 Like
Astronaut
884 106 197

Yup, that's probably where you're going to want to edit. All that if statement is saying is that "If there is a collection description, show it". So you can just comment that out like @cnvs said.

If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
0 Likes