durangod Posted June 11, 2014 Share Posted June 11, 2014 quick question. when adding some js to a tpl file, does the literal go before or after the script tag. i have seen it both ways. for example... like this (1): {literal} <script> whatever... </script> {/literal} or like this (2): <script> {literal} whatever... {/literal} </script> which is proper? thanks 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 11, 2014 Share Posted June 11, 2014 if it helps, I always use the first method... 0 Quote Link to comment Share on other sites More sharing options...
durangod Posted June 11, 2014 Author Share Posted June 11, 2014 Thanks brian, i do as well. But i found one that is the other way and i think its wrong, and i think i did it a long time ago lol.. so i wanted to check to be sure. 0 Quote Link to comment Share on other sites More sharing options...
searley Posted June 11, 2014 Share Posted June 11, 2014 I think the rule is, if it works it's ok 0 Quote Link to comment Share on other sites More sharing options...
durangod Posted June 11, 2014 Author Share Posted June 11, 2014 I believe that is "if it works dont fix it" lol but i did anyway lol 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted June 11, 2014 Share Posted June 11, 2014 both will work with you, also some times this method used when needed {literal} <script type="text/javascript"> var somename = '{/literal}{$smartyTag}{literal}'; </script> {/literal} this helpful when you need to pass values from smarty to it 0 Quote Link to comment Share on other sites More sharing options...
Tembe Posted August 23 Share Posted August 23 Hello. I want to add this code on the footer. Problem the footer just disappeared <!-- Buttonizer --> <script type="text/javascript"> (function(n,t,c){var o=t.createElement("script");o.async=!0,o.src="https://cdn.buttonizer.io/embed.js",o.onload=function(){window.Buttonizer.init(c)},t.head.appendChild(o)})(window,document,"a74cdf08-6374-4d0e-b56d-da78871e00a8"); </script> <!-- End Buttonizer --> 0 Quote Link to comment Share on other sites More sharing options...
RadWebHosting Posted August 30 Share Posted August 30 You need to place the custom code in your template's footer.tpl 0 Quote Link to comment Share on other sites More sharing options...
twhiting9275 Posted August 31 Share Posted August 31 On 8/23/2024 at 1:22 PM, Tembe said: Hello. I want to add this code on the footer. Problem the footer just disappeared <!-- Buttonizer --> <script type="text/javascript"> (function(n,t,c){var o=t.createElement("script");o.async=!0,o.src="https://cdn.buttonizer.io/embed.js",o.onload=function(){window.Buttonizer.init(c)},t.head.appendChild(o)})(window,document,"a74cdf08-6374-4d0e-b56d-da78871e00a8"); </script> <!-- End Buttonizer --> Take a look at some of the examples on the smarty docs page. they'll get you started 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.