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

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



Advertisement


Ads help me to help you! Thanks!

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


  Comment Form






Note: your IP address will be stored on submit. I reserve the right to change or delete your response without notice! In case of abuse your IP address will be blocked!

GDPR privacy disclaimer
This form will send me your email address and your IP address.
If you don't want that, don't use this 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.10
  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! Buy products from these advertisers!

Ads help me to help you! Thanks!