HAIRWEBSHOP Posted June 15, 2016 Share Posted June 15, 2016 (edited) Hello,We want to add Google Translate code to our theme's header.tpl nav class, but for some reason it will result into an error.Can someone please help us figure out what's going on? We're not interested in using modules btw. Thank you in advance! Fatal error: Uncaught --> Smarty Compiler: Syntax error in template "/htdocs/www/themes/default-bootstrap/header.tpl" on line 102 "new google.translate.TranslateElement({pageLanguage: 'nl', includedLanguages: 'de,en,fr,nl', layout: google.translate.TranslateElement.InlineLayout.SIMPLE, gaTrack: true, gaId: 'xxx'}, 'google_translate_element');" - Unexpected ": ", expected one of: "}" <-- thrown in/home/htdocs/www/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 102 Edited June 16, 2016 by HAIRWEBSHOP (see edit history) Link to comment Share on other sites More sharing options...
rocky Posted June 15, 2016 Share Posted June 15, 2016 It's because Smarty is confusing some of the JavaScript as Smarty code. You should add a space after every { in the JavaScript code, then it should work. 2 Link to comment Share on other sites More sharing options...
HAIRWEBSHOP Posted June 15, 2016 Author Share Posted June 15, 2016 Hello rocky, and thank you kindly for your reply. Your solution worked perfectly, thank you! Link to comment Share on other sites More sharing options...
rocky Posted June 16, 2016 Share Posted June 16, 2016 I'm happy it worked for you. Please edit your first post and add [sOLVED] to the front of the title. 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