MooMooHost Posted August 7, 2017 Share Posted August 7, 2017 Currently, I know I need to modify the .tpl files. I have done so and am pretty satisfied with my current results, however, when I tried to put a script into a certain page, it does not load It does work when I disable text rich editor, and paste the code in a knowledgebase article . EG . https://moomoohost.com/index.php?rp=/knowledgebase/4/Testimonials.html However, when I paste it plainly in the .tpl file, I get nothing The script in question is a widget from widgetpacks. The script goes something like <script> bla bla bla bla </script> Thanks in advanced 0 Quote Link to comment Share on other sites More sharing options...
MooMooHost Posted August 7, 2017 Author Share Posted August 7, 2017 My apologies I have an error log that is coupled with the page that i tried putting the script : It is here MooMoo Smarty Error: Syntax error in template "file:/home/moomooho/public_html/templates/webhoster2/testimonial.tpl" on line 15 "wpac_init.push({widget: 'Comment', id: 6531});" - Unexpected ": ", expected one of: "}" 115.135.128.141 Sorry for the double post, I cannot edit the initial post 0 Quote Link to comment Share on other sites More sharing options...
RadWebHosting Posted August 7, 2017 Share Posted August 7, 2017 It seems the line 15 has a ": " when your PHP expected "}" 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 7, 2017 Share Posted August 7, 2017 if you're using a 3rd party theme, e.g webhoster, and you're trying to add pages to it - your best bet is to contact the developer. and certainly if you're going to post here, we need to see code... a .tpl file by itself will likely need a corresponding php file. 0 Quote Link to comment Share on other sites More sharing options...
MooMooHost Posted August 12, 2017 Author Share Posted August 12, 2017 Ahh i'll get back at them I'll post the results soon in case anyone might have the same template and the same question 0 Quote Link to comment Share on other sites More sharing options...
WebsiteIntegrations Posted August 14, 2017 Share Posted August 14, 2017 did you try {literal} <script> content </script> {/literal} Though looking at the page I guess you figured it out? 0 Quote Link to comment Share on other sites More sharing options...
MooMooHost Posted August 14, 2017 Author Share Posted August 14, 2017 Yes, the theme metro ( theme coder ) tried it too. Said it doesnt work Hello Sir, I tried by using {literal} {/literal} tags but still not working, I would like to advise contact WHMCS support for this. OR you may try by using hook. Because its not seems template issue. -- Thanks and Regards, Theme Metro Team Their English isn't that good, but I guess I'll stick with pasting the raw HTML into my knowledge base article haha 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 14, 2017 Share Posted August 14, 2017 try using {literal} tags just around those two opening js lines... <div id="wpac-review"></div> <script type="text/javascript"> {literal} wpac_init = window.wpac_init || []; wpac_init.push({widget: 'Review', id: 6643});{/literal} ... then rest of widget code i've just quickly added that to homepage.tpl and it works fine. ... and Support wouldn't be an option - they'd just tell you it was a customisation and send you back to these forums, or tell you to get a developer... the hook idea would almost certainly work though. 0 Quote Link to comment Share on other sites More sharing options...
MooMooHost Posted August 14, 2017 Author Share Posted August 14, 2017 Brian, it works Hurrah ! Thanks so much 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.