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

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



Buy Me A Coffee


  Comment Form

ReviewManager

Click here to open the form

ReviewManager

  2 Comments

Buy Me A Coffee

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.19
  Last updated: 23-06-2018
  Comments: 2
  http://cms.ms/nrvV


Buy Me A Coffee




Advertisement


Ads help me to help you! Thanks!

Ads help me to help you! Buy products from these advertisers!