Add two descriptions in collections page

Highlighted
New Member
16 0 0

Two descriptions can be put in the collections page? That is, a shorter above products, then a much longer with more description below. Because if you put up a lot of information, so people do not scroll, and if you put all low, many people or get to see.
If you can, how it is done?

0 Likes
Highlighted
Shopify Expert
24 0 1

Hi You can use split filter to cut of description before and after.

You need to use 

{{ collection.description | split: '<!-- split -->' | first }}
{{ collection.description | split: '<!-- split -->' | last }}

Edit your collection description in html view and add 

<!-- split --> for separate description. Then edit collection.liquid to display customized description by putting above code

Hope this helps

Thanks

Feel free to contact with us if you need help related to shopify. https://shopipoint.com - Shopify expert
1 Like
Highlighted
Shopify Expert
539 24 106

You could add the short description and the long description in the editor and put <!-- split --> in between them, like so:


short description...

<!-- split -->

longer description

Then, in the code of the collection.liquid template, you can access both parts like this:

{% assign descriptions = collection.description | split: "<!-- split -->" %}
{% assign short_desc = descriptions[0] %}
{% assign long_desc = descriptions[1] %}

Then put the individual descriptions whereever you want them on the page with {{ short_desc }} and {{ long_desc }}, respectively.

★ ThemeUp: Nifty Upgrades for your Shopify Store ★ https://themeup.net
2 Likes
Highlighted
New Member
16 0 0

Thank you very much. All I know not how to put the <!-- split --> in the editor because you do not catch me.

Yes, I get the description above where I put the {{ short_desc }} code, but leaves whole.

0 Likes
Highlighted
Shopify Expert
539 24 106

You will also have to look for a code like {{ collection.description }}, that's what inserts the full description. You can either delete it or surround it with {% comment %} and {% endcomment %} tags.

★ ThemeUp: Nifty Upgrades for your Shopify Store ★ https://themeup.net
0 Likes
Highlighted
New Member
16 0 0

Yes, yes, that I have said to no longer leave. What does not recognize me is the split in the editor. How do I have to put? Within some HTML command?

0 Likes
Highlighted
Shopify Expert
539 24 106

You just add the <!-- split --> like you would add any other text in the editor's regular WYSIWYG mode, not in HTML mode.

★ ThemeUp: Nifty Upgrades for your Shopify Store ★ https://themeup.net
0 Likes
Highlighted
New Member
16 0 0
Highlighted
Shopify Expert
9852 98 1614

The <!-- split --> should be added when editing in HTML mode - not when editing in Rich Text mode. 

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Highlighted
New Member
4 0 0

Hi everybody, 

 

first off all, thanks for your explanation. Do you mind to help me out, too?

 

I'm facing the same problem discussed in this thread but my issue rather refers to the question what exactly of the collection.description needs to be replaced? The entire {% if collection.description%} tag or just the {{collection.description | strip_html }} part (see attached)? By the way, what does the strip_html mean? 

 

As background information, my collection.liquid in the templates file refers to the collection.liquid in the sections file. I found it out by following the instructions of this article https://www.kumodigital.co.uk/add-a-short-and-long-description-to-a-shopify-collections-page-templat..., but I'm still uncertain what to replace. 

 

I would be very grateful for your advise. 

 

Best regards

Yemin

 

Bildschirmfoto 2020-03-30 um 20.12.11.png

0 Likes