Tagsmarty template

Adding Javascript To Smarty Templates

A

I was figuring out how to include Javascript in Smarty templates this afternoon, because you can’t include them directly. After digging around a bit, I realised that all you had to do was to include the Javascript code within {literal}{/literal} tags, like this:
{literal}

{/literal}
And once that’s done, you can use Javascript in your Smarty template. Problem solved! 🙂

About Author

I've over 17 years of entrepreneurship experience, having built a tech company to be the top in the country, which was subsequently acquired for an 8-figure sum. As CEO, I led the company through robust growth to 150 employees across 4 countries. After the acquisition, I embraced minimalism, sold off my personal possessions, and started living around the world.

Read more about my story here.