Need help with 'collection-template.liquid'

Finettchi
Tourist
5 0 2

Ok, so I am customising the header for the collection through collection-template.liquid

When a collection does not have a collection image I want it to show this code..

<div class="hero-box-collection">
  <h2 class="hero-header-collection"> {{ collection.title }}
  </h2>
  <h2 class="hero-text-collection">{{- collection.description -}}<a href="www.finettchi.com">www.finettchi.com</a></h2>
  </div>

 

& when a collection does have an image I want this code to show...

              <div class="collection-hero-im" style=" background-image: url({{ collection.image | img_url: '800x' }});">
<div class="hero-box-collection">
  <h2 class="hero-header-collection"> {{ collection.title }}
  </h2>
  <h2 class="hero-text-collection">{{- collection.description -}}<a href="www.finettchi.com">www.finettchi.com</a></h2>
  </div>
</div>

 

any help is welcomed  

0 Likes