EDIT Home Page "Collection List" URL (Brooklyn)

New Member
2 0 0


I am hoping someone can help, I could only find one other answer to this and when I tried it, it went a bit whacky.

I have a "Collections List" on my homepage - this is three images with links to their corresponding collections. I would like for the images to instead link to a direct product.

I used some code that I found in another question and it kind of worked and kind of didn't, I was able to link them to direct products and bypass the automated "collection" page, but for some reason, the first and third images are linking to the same page regardless of the URL I have entered.

I entered the below code under SNIPPITS "collection.grid.item.liquid"

<div class="grid__item {{ grid_item_width }} collection-collage__item text-center">
  {% if template == 'list-collections' %}
  <a href="/products/the-courtney" class="collection-grid__item-link collection-collage__item-wrapper">
  {% else %}
       {% if forloop.index == 2 %}
  <a href="/collections/the-darce/products/the-darce" class="collection-grid__item-link collection-collage__item-wrapper">
  {% else %}
  <a href="/products/the-gaby" class="collection-grid__item-link collection-collage__item-wrapper">
  {% endif %}  
  {% endif %}  


So "The Courtney" and "The Gaby" are both linking to "The Gaby. "The Darce" is linking to her correct page.

I so appreciate any help! I am a first time user!