Create Custom Template

From Secure Web Gateway
Revision as of 00:31, 25 July 2021 by Manish (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Overview

Templates are used throughout SafeSquid as a replacement for pages which can't be displayed due to filtering, error, or other conditions. Customized templates can be really useful, when you would want the error messages to be displayed in a language other than English. It can also be used to display your company logo, warning or message like 'If you feel this site was unnecessarily blocked, please notify the administrator on helpdisk@mycompany.com'.

A template may not necessarily be an html, but can be almost about anything like an audio file, flash file or an executable. It can be used to invoke a file for a specific condition. For example, SafeSquid has 3 built-in templates - tinygif (a 1x1 transparent gif image), checkeredgif (a 4x4 gray and transparent checkered pattern), and tinyswf (an empty flash animation). The checkeredgif template is used by default, to replace images that it blocked by the Pornographic Image Filter add-on module that is used to block pornographic images in real time. So, when the page is displayed to a user, a block of checkered boxes is displayed instead of the blocked image.

 

Prerequisites

Create your own html file and place that file in the below paths

for windows version of SafeSquid:

c:\ProgramData\usr\local\safesquid\ui_root\templates

The path for Linux version of SafeSquid is : 

/usr/local/safesquid/ui_root/templates/

Note : If you want to use any images in the html file make sure that the image also exist in the same path.

Example:

Here i am creating below html page:

Html exapmle.png

I Am saving this file with name :

Custom_template.html

I will use this file in the below configuration 

Access the SafeSquid user interface

Go to Configure Page

Goto configure.png

Go to Custom Settings

 

Click on custom settings.png

Go to Templates

 

Custom templates4.png

Clone existing entry

 

 

Custom templates5.png

Edit the original entry

 

 

Custom templates6.png

 

You  must edit the original entry, because the entries in template section are processed from top to bottom

Custom templates7.png

 

 

 

Custom templates8.png

 

 

 

Custom templates9.png

 

 

 

Custom templates10.png

 

 

Customtemplate11.png

 

 

 

Customtemplate12.png

Testing

 

Customtemplate13.png

Saving the Configuration 

 
Save config final.png