Page 1 of 1
Smarty error in tpl_head?? (SOLVED)
Posted: Thu Jul 31, 2008 10:31 am
by jan_hut
I'm getting this error:
Code: Select all
string(130) "Smarty error: [in tpl_head:21 line 20]: syntax error: unrecognized tag: margin-bottom: -3px; (Smarty_Compiler.class.php, line 446)" string(111) "Smarty error: [in tpl_head:21 line 20]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" string(129) "Smarty error: [in tpl_head:21 line 21]: syntax error: unrecognized tag: margin-bottom:-4px; (Smarty_Compiler.class.php, line 446)" string(111) "Smarty error: [in tpl_head:21 line 21]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)"
I was assuming there would be a tpl_head file containing an illegal { or }. But no. The error only occurs on "album" pages and I'm using the standard lightbox template in Album.
Re: Smarty error in tpl_head??
Posted: Fri Aug 01, 2008 12:09 pm
by jan_hut
Can anyone at least tell me where to find "tpl_head"

It should be easy to circumvent using {literal} around the margin tags but for the life of me I just can't find this tpl_head thing.....
Re: Smarty error in tpl_head??
Posted: Fri Aug 01, 2008 9:19 pm
by Dr.CSS
What ver. of what?...
I would think it has to do with some files missing, you can go to the forge and download Album the n FTP it to your site to see if that helps...
Re: Smarty error in tpl_head??
Posted: Sat Aug 02, 2008 7:49 am
by jan_hut
I was thinking the same so I've replaced all album files from the tar (instead of importing the xml) but the error remains.
I'm reinstalling to see if the error is reproduced
Re: Smarty error in tpl_head??
Posted: Sat Aug 02, 2008 8:23 am
by jan_hut
It seems that I have found the problem, or at least a part of it.
I'm getting the following error:
string(130) "Smarty error: [in template:20 line 24]: syntax error: unrecognized tag: margin-bottom: -3px; (Smarty_Compiler.class.php, line 446)" string(111) "Smarty error: [in template:20 line 24]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)" string(129) "Smarty error: [in template:20 line 25]: syntax error: unrecognized tag: margin-bottom:-4px; (Smarty_Compiler.class.php, line 446)" string(111) "Smarty error: [in template:20 line 25]: syntax error: unrecognized tag '' (Smarty_Compiler.class.php, line 590)"
I've added a global contentblock named JavaScript for IE page width containing the following code:
{literal}
=b){nw=b+"px";}if(w
{/literal}
I'm calling this in the standard template with the following code:
{global_content name='JavaScript for IE page width'}
#primary-nav li {margin-bottom: -3px;}
#primary-nav li:hover {margin-bottom:-4px;} /* a HACK!!! for IE7 */
This removes the error from all pages except the Album pages. Seems to me that all I have to do is incorporate above code in the Album template that I'm using, since for some reason it seems to be bypassing it in the normal template when an Album page is generated. The question is.....how?????
Re: Smarty error in tpl_head??
Posted: Sat Aug 02, 2008 9:50 am
by kermit
in templates and page content... scripts and css containing {curly braces} must be placed inside a {literal} ... {/literal} block to keep smarty (the template engine) from trying to interpret them... so:
#primary-nav li {margin-bottom: -3px;}
#primary-nav li:hover {margin-bottom:-4px;} /* a HACK!!! for IE7 */
becomes
{literal}
#primary-nav li {margin-bottom: -3px;}
#primary-nav li:hover {margin-bottom:-4px;} /* a HACK!!! for IE7 */
{/literal}
Re: Smarty error in tpl_head??
Posted: Sat Aug 02, 2008 7:20 pm
by jan_hut
Ah thanks kermit........I knew about using {literal} but didn't think I was gonna need it if the code is within
Problem solved!