How to code a private collection for specific customer tags?

Hello, I have seen videos on how to make a collection private with code, however, the screen is different when I go in to add a template to make the collection private to only customers who are tagged. Can you please provide code on how to make a collection private to only customers with a specific tag? I don’t want to have to purchase an app to do this if I can just add the code. Thanks.

The code I found looks like this however, the code is very different when you add a template now.

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

{% section ‘collection’ %}

{% else %}

{{ pages.no-access.content }}

{% endif %}

Currently when you add a template, you get all this below instead of the simple {% section ‘collection’ %} listed above! PLEASE HELP!!

{% if settings.category_layout == “default” %}

{% include ‘collection-default’ %}

{% elsif settings.category_layout == “right_sidebar” %}

{% include ‘collection-right-sidebar’ %}

{% elsif settings.category_layout == “full_with” %}

{% include ‘collection-fullwidth’ %}

{% elsif settings.category_layout == “with_banner” %}

{% include ‘collection-with-banner’ %}

{% elsif settings.category_layout == “mansory” %}

{% include ‘collection-mansory’ %}

{% elsif settings.category_layout == “express_order” %}

{% include ‘collection-express-order’ %}

{% elsif settings.category_layout == “no_sidebar” %}

{% include ‘collection-no-sidebar’ %}

{% endif %}

Hi @nouritress ,

I’m having the same issue you are: Shopify updated their platform code to OS 2.0, which means that the old way of doing this no longer applies. Now they are using collection.JSON to accomplish the same thing collection.liquid used to do. I don’t know what the fix is, but I hope that they find one.

-Evan

Did you ever find an answer to this question? Honestly I am stuck on this too.