Test templates without breaking the frontend

  Previous article Next article  

Test templates without breaking the frontend

  Article optimized for CMSMS 2.x

  Author:
  Last tested in: CMSMS 2.2.5
  Last updated: 21-01-2018
  Comments: 0
  http://cms.ms/nrvV

You need to do some tests at your website, but you don't want to break the frontend for the visitors.
A simple solution using Smarty.

  How to use

Your current IP address is: 54.234.65.78
This way only you will see the template vars:

{if $smarty.server.REMOTE_ADDR == '54.234.65.78'}
  {get_template_vars}
{/if}

<!-- The template content -->

Another example, testing a module like CGFeedback without letting it show to the public.

<!-- The template content -->

{if $smarty.server.REMOTE_ADDR == '54.234.65.78'}
  {CGFeedback key1=$foo key2=$bar}
{/if}

This content is only visible at the frontend when you are logged in into the Admin, it is hidden for regular visitors.

{$uid = get_userid(FALSE)}
{if $uid > 0}
 {get_template_vars}
{/if}

<-- The template content -->





CMS Made Simple 2.2.5 - Tutorials, tips and tricks - CMSMS 2.2.5

Test templates without breaking the frontend

  Article optimized for CMSMS 2.x

  Author:
  Last tested in: CMSMS 2.2.5
  Last updated: 21-01-2018
  Comments: 0
  http://cms.ms/nrvV