Jump to content

Question about modifying the template


MooMooHost

Recommended Posts

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 :)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 :P

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated