strange behaviour of the <head>-tag (CMSms v2.1.2)
Posted: Fri Feb 05, 2016 10:39 pm
I read on a page that the <head>-tag can be omitted in HTML5. So I tried it out by putting it into smarty comments like this
and of course the closing head-tag as well, saving the template, reloading my webpage and Oops! getting an error:
Error: at line 29 in file /.../cmsms/lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php:
with the message:
Syntax error in template "tpl_top:14" on line 29 "{*" - Unexpected "*"
If I put the head into an html-comment like
that's fine but if I put this code into smarty comments like
then I get again an Oops! error:
Error: at line 29 in file /.../cmsms/lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php:
with the message:
Syntax error in template "tpl_top:14" on line 29 "{*
If I put the comments the other way around like this:
I get again an Oops! error:
Error: at line 29 in file /.../cmsms/lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php:
with the message:
Syntax error in template "tpl_top:14" on line 29 "
Of course I just could have deleted the <head>-line but I found it a strange behaviour that the <head>-tag cannot be placed inside a smarty comment. This behaviour might point to a hidden bug.
I also noticed that any white space in front of the <head>-tag gets deleted in the output html file. Why is this?
Code: Select all
{* <head> *}
Error: at line 29 in file /.../cmsms/lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php:
with the message:
Syntax error in template "tpl_top:14" on line 29 "{*" - Unexpected "*"
If I put the head into an html-comment like
Code: Select all
<!-- <head> -->
Code: Select all
{* <!-- <head> --> *}
Error: at line 29 in file /.../cmsms/lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php:
with the message:
Syntax error in template "tpl_top:14" on line 29 "{*
If I put the comments the other way around like this:
Code: Select all
<!-- {* <head> *} -->
Error: at line 29 in file /.../cmsms/lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php:
with the message:
Syntax error in template "tpl_top:14" on line 29 "
Of course I just could have deleted the <head>-line but I found it a strange behaviour that the <head>-tag cannot be placed inside a smarty comment. This behaviour might point to a hidden bug.
I also noticed that any white space in front of the <head>-tag gets deleted in the output html file. Why is this?