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 %}
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025