Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I need to create a few pages that are viewable by logged-in staff only. If someone else tries to load these pages, it should just redirect to the homepage. Has anyone found a way to accomplish this? It's a shame there is no native liquid magic to do something like this. e.g. {% if staff.logged_in %} or similar.
hey, Jacobgraf.
Adding a tag 'Staff' to the staff accounts and then doing the validation using that wouldn't work?
I've seen some do this... make your pages have a 'staff-only' template, check the content_for_header object for 'adminBarInjector' which only is included if you're visiting the site in the same browser you are also logged into the admin in.
{% if template.suffix == 'staff-only' %}
{% if content_for_header contains 'adminBarInjector' %}
... staff only content
{% else %}
<script>window.location.href = '/';</script>
{% endif %}
{% endif %}
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025