Template Tags

Last updated: August 28th 2019

You can check weather the entry is restricted or not just by passing that entry ID through this code {exp:super_restricted_entries:check} . This code has only 1 parameter which is required. Parameter is entry_id

Example 1: (Check if granted)
{exp:channel:entries channel="blog" url_title="{last_segment}" require_entry="yes"}
    {exp:super_restricted_entries:check entry_id="{entry_id}"}
    {if super_restricted_entries:granted}
        <p> <strong>Granted: </strong>{title}<br></p>
    {/if}
    {/exp:super_restricted_entries:check}
{/exp:channel:entries}
Example 2: (Check for not granted)
{exp:channel:entries channel="blog" url_title="{last_segment}" require_entry="yes"}
    {exp:super_restricted_entries:check entry_id="{entry_id}"}
    {if ! super_restricted_entries:granted}
        {redirect="404"}
    {/if}
    {/exp:super_restricted_entries:check}
{/exp:channel:entries}
Example 3: Mix example for granted and not granted:
{exp:channel:entries channel="blog" dynamic="no"}
    {exp:super_restricted_entries:check entry_id="{entry_id}"}
    {if super_restricted_entries:granted}
        <p> <strong>Granted: </strong>{title}<br></p>
    {if:else}
        <p> <strong>NOT Granted: </strong>{title}<br></p>
    {/if}
    {/exp:super_restricted_entries:check}
{/exp:channel:entries}