Posted By

hotdiggity on 12/01/11


php snippet modx

Versions (?)

MODx hide development site

 / Published in: PHP

Set up a basic template:

[[++site_name]] - [[*pagetitle]] ​ [[*content]]


The ACME web site is currently under development

Please // ' + 'email us' + '' ) // ]]> for all enquiries.

..and set this page as the Unauthorised Page in system settings.

Put this snippet at top of every other template:


Now only web manager users logged in will be able to view the full site. Change to 'web' for web users.

Snippet code:

  1. <?php
  2. if (!($mgrUserId = $modx->getLoginUserID('mgr'))) {
  3. $modx->sendUnauthorizedPage();
  4. }

Report this snippet  

You need to login to post a comment.