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 %}
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025