My website which runs on CMS Made Simple is running into a fatal error and now it does not work

362 Views Asked by At

My site is not working anymore. I get the following error:

Syntax error in template "tpl_head:tpl_head:16" on line 8 "!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?n.callMethod.apply(n,arguments):n.queue.push(arguments)};" - Unexpected ".", expected one of: "","" , ")"

I have been trying to find a solution to the problem. But I keep hitting a dead end.

The stack trace is as follows:

0 /lib/smarty/sysplugins/smarty_internal_templateparser.php(2727): Smarty_Internal_TemplateCompilerBase->trigger_template_error()

1 /lib/smarty/sysplugins/smarty_internal_templateparser.php(2786): Smarty_Internal_Templateparser->yy_syntax_error(45, '.')

2 /lib/smarty/sysplugins/smarty_internal_smartytemplatecompiler.php(114): Smarty_Internal_Templateparser->doParse(45, '.')

3 /lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php(404): Smarty_Internal_SmartyTemplateCompiler->doCompile('\r\n...', true)

4 /lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php(336): Smarty_Internal_TemplateCompilerBase->compileTemplateSource(Object(Smarty_Internal_Template), false, NULL)

5 /lib/smarty/sysplugins/smarty_template_compiled.php(204): Smarty_Internal_TemplateCompilerBase->compileTemplate(Object(Smarty_Internal_Template))

6 /lib/smarty/sysplugins/smarty_template_compiled.php(100): Smarty_Template_Compiled->compileTemplateSource(Object(Smarty_Internal_Template))

7 /lib/smarty/sysplugins/smarty_template_compiled.php(163): Smarty_Template_Compiled->process(Object(Smarty_Internal_Template))

8 /lib/smarty/sysplugins/smarty_internal_template.php(206): Smarty_Template_Compiled->render(Object(Smarty_Internal_Template))

9 /lib/smarty/sysplugins/smarty_internal_templatebase.php(216): Smarty_Internal_Template->render(false, 0)

10 /lib/smarty/sysplugins/smarty_internal_templatebase.php(107): Smarty_Internal_TemplateBase->_execute(Object(Smarty_Internal_Template), NULL, NULL, NULL, 0)

11 index.php(161): Smarty_Internal_TemplateBase->fetch()

12 {main}

If someone could help me in letting me understand what could be the problem, I will be very grateful. PLease help.

1

There are 1 best solutions below

0
KiwiChris On

The problem is that Smarty (the PHP template engine used) is trying to parse everything immediately within any curly brackets {}, i.e. your javascript.

So you can either:

  1. place {literal} {/literal} tags around the outside of your javascript

  2. in your javascript follow each left curly bracket with a space '{ ' and precede every right curly bracket with a space ' }'. This tells Smarty that this is not Smarty code and not to parse it.

  3. put your javascript in a separate file