Liquid error: Error in tag 'section' - 'collection' is not a valid section type

Hey guys!

The original idea was to create a private collection for a specific group of client.

I’ve attempted to create a collection.template to restrict access to that collection but I keep getting a error message when I have the required Tag for as a client . The ‘‘else’’ part works find, the client is redirect to my ‘‘no-access’’ page.

Liquid error: Error in tag ‘section’ - ‘collection’ is not a valid section type

{%if customer.tags contains ‘groupesignalisation’%}

{%section ‘collection’%}

{%else%}

{{ pages.no-access.content}}

{%endif%}

Any suggestion??

Is there a schema in your sections/collection.liquid file?

EDIT: Nevermind, just noticed you’re using Dawn which doesn’t have collection.liquid. Looking at your collection JSON template:

Based on this you probably want to use {% section ‘main-collection-product-grid’ %}, potentially also want to add {% section ‘main-collection-banner’ %} before that.

4 Likes

Works perfecly thank you!

1 Like

Hi sorry how would i do this ?
do i need to use json or can i use liquid ?
what would the code be ?
thanks

Hiya, I just came across this error myself and have fixed it :slightly_smiling_face: However, if I search for the product and not logged in as VIP, the product will come up in the search and I can purchase it. Does this happen for you too?

Was this ever fixed? I still need help thanks

Hi. When i added main-collection-banner its now showing me 2 error.

Liquid error (templates/collection.Wholesale line 2): Error in tag ‘section’ - ‘main-collection-banner’ is not a valid section type Liquid error (templates/collection.Wholesale line 3): Error in tag ‘section’ - ‘main-collection-product-grid’ is not a valid section type