Smarty Literal Tag

Using PHP {literal}{/literal} Tags

Literal tags which use the syntax {literal}{/literal} can be used to take the code literally within the '.tpl' file, thus, not interpreting it. Two common places where you would use the literal tags are with CSS and Javascript.

CSS

<style type="text/css">
{literal}
body, label {font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
}
{/literal}
</style>

Javascript

In this example, the literal tags go around the Javascript.

{literal}
<script>

$(document).ready(function() {
$( "#email" ).click(function() {
  alert("Hey2");
   });

});

</script>
‚Äč{/literal}