rofli123 Posted February 16, 2017 Share Posted February 16, 2017 Hi. var example = '{$cms->id}' works if script source is within .tpl file. If you link external script then you can't use smarty variables on it like that. Or can you? Is it possible to access smarty variables from script source outside of .tpl file? Regards Link to comment Share on other sites More sharing options...
joseantgv Posted February 16, 2017 Share Posted February 16, 2017 Yes you can, if smarty variable is defined before script execution. You can also execute your script on $( document ).ready() so the variable should be ready. You can also try with addJsDef Link to comment Share on other sites More sharing options...
rofli123 Posted February 24, 2017 Author Share Posted February 24, 2017 Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now