Community Forums

Discuss, share and get help from our community of friendly WHMCS users

Close
Login to Your Account
Results 1 to 9 of 9
  1. #1
    Join Date
    Aug 2017
    Posts
    8

    Default Question about modifying the template

    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=...timonials.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

  2. #2
    Join Date
    Aug 2017
    Posts
    8

    Default Re: Question about modifying the template

    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

  3. #3
    Join Date
    Feb 2016
    Location
    Dallas
    Posts
    35

    Default Re: Question about modifying the template

    It seems the line 15 has a ": " when your PHP expected "}"
    RAD WEB HOSTING - Enterprise Dallas, TX Data Center - Clearance Dedicated Servers

  4. #4
    Join Date
    Feb 2013
    Location
    UK
    Posts
    6,969

    Default Re: Question about modifying the template

    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.

  5. #5
    Join Date
    Aug 2017
    Posts
    8

    Default Re: Question about modifying the template

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

  6. #6
    Join Date
    Jul 2010
    Location
    Ontario, Canada
    Posts
    666

    Default Re: Question about modifying the template

    did you try

    Code:
    {literal}
    <script>
    content
    </script>
    {/literal}
    Though looking at the page I guess you figured it out?
    Your #1 Source For All Your Integration Needs! - WebsiteIntegrations.Com
    Matching Your WHMCS, Wordpress, Forums and Other Scripts to Your Site Design. We Offer Responsive WHMCS Integrations!

  7. #7
    Join Date
    Aug 2017
    Posts
    8

    Default Re: Question about modifying the template

    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

  8. #8
    Join Date
    Feb 2013
    Location
    UK
    Posts
    6,969

    Default Re: Question about modifying the template

    try using {literal} tags just around those two opening js lines...

    PHP Code:
    <div id="wpac-review"></div>
    <
    script type="text/javascript">
    {
    literal}
    wpac_init window.wpac_init || [];
    wpac_init.push({widget'Review'id6643});{/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.

  9. #9
    Join Date
    Aug 2017
    Posts
    8

    Default Re: Question about modifying the template

    Brian, it works Hurrah ! Thanks so much

Similar Threads

  1. template question
    By JesusM in forum Spanish
    Replies: 1
    Last Post: 10-12-15, 10:46 PM
  2. Replies: 3
    Last Post: 01-11-14, 07:32 AM
  3. Replies: 4
    Last Post: 02-28-10, 06:35 PM
  4. Template Question?
    By pbhosting in forum Developer Corner
    Replies: 2
    Last Post: 03-20-08, 01:17 AM
  5. 2.5.6 template question
    By irishnet in forum Using WHMCS
    Replies: 1
    Last Post: 08-28-06, 03:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •