Reputation: 4483
I'm using the Luna theme of Big Cartel.
My shop sits on /products and clicking on a shop category links to /category/tees or /category/accessories etc.
The /products page currently shows a list of all products in the store. I want to change that to show a list of categories
Is there a way to check if I'm on a category page or on the shop landing page?
I also tried the following but it doesn't seem to work
{% if page.url == '/products' %}
// Show categories grid
{% else %}
// Show category products
{% endif %}
Any help would be appeciated
Upvotes: 0
Views: 1294
Reputation: 945
Use the page.full_url
variable with contains
for best results:
{% if page.full_url contains '/category' %}
// Show category products
{% else %}
// Show categories grid
{% endif %}
Upvotes: 0