Dynamic home page collection based on button click = true

New Member
3 0 0


I am trying to implement a div container where buttons that are clicked populate the corresponding collection. I have seen some websites use aria-label=false and then when clicked set to true. I have also seen others use a paginator type method. 

my best effort is the following:



{% if collection.handle == 'sale'%}

{% include 'list-collections-template' | collection.sale %}

{% endif %}


I haven't included the onclick button function as I'm trying to seperate the task completion.

I have tried so many others but nothing seems to work.