Difference between revisions of "How to make part of theme visible only to administrators"

From JReviews Documentation
Jump to: navigation, search
 
Line 1: Line 1:
 +
<div class="successbox" style="width: 95%">
 +
 +
[https://www.jreviews.com/docs/theme-resources/conditionals-based-on-user-authentication There's a new version of this article]
 +
 +
</div>
 +
 
Use this code:
 
Use this code:
  

Latest revision as of 23:55, 8 July 2020

Use this code:

JReviews 2

<?php if($this->Access->isAdmin()):?>
   // Everything here will be available only to admins
<?php endif;?>

JReviews 3

<?php if($this->auth->admin):?>
   // Everything here will be available only to admins
<?php endif;?>