MENU

Test templates without breaking the frontend

  Previous article Next article  

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.81.76.247
This way only you will see the template vars:

{if $smarty.server.REMOTE_ADDR == '54.81.76.247'}
  {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.81.76.247'}
  {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 -->




  Comment Form

Click here to open the form


  1 Comment

CMS Made Simple - Tutorials, tips and tricks - CMSMS

Test templates without breaking the frontend

  Article optimized for CMSMS 2.x

  Author:
  Last tested in: CMSMS 2.2.7
  Last updated: 23-06-2018
  Comments: 1
  http://cms.ms/nrvV

Advertisement



Ads help me to help you! Thanks!

Ads help me to help you! Thanks!

Ads help me to help you! Thanks!