Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Only allow page access to Admins
{% if customer %}
{% if customer.tags contains 'admin' %}
<a name="pagecontent" id="pagecontent"></a>
<div class="sixteen columns page clearfix">
<h1>
{{ page.title }}
</h1>
<div class="feature_divider"></div>
<div>
{% include 'page-multi-column', content: page.content %}
</div>
</div>
{% else %}
<div class="container">
<div class="sixteen columns">
<h1>{{ product.title }}</h1>
<div class="feature_divider"></div>
<p>Access denied</p>
</div>
</div>
{% endif %}
{% else %}
<div class="container">
<div class="sixteen columns">
<h1>{{ product.title }}</h1>
<div class="feature_divider"></div>
<p>You must must be logged in to access this page. <a href="/account/login">Please login here</a>.</p>
</div>
</div>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment