strange behaviour of the <head>-tag (CMSms v2.1.2)

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
so what?
Forum Members
Forum Members
Posts: 17
Joined: Thu Nov 27, 2008 3:38 am

strange behaviour of the <head>-tag (CMSms v2.1.2)

Post by so what? »

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

Code: Select all

{* <head> *}
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

Code: Select all

<!-- <head> -->
that's fine but if I put this code into smarty comments like

Code: Select all

{* <!-- <head> --> *}
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:

Code: Select all

<!-- {* <head> *} -->
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?
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1973
Joined: Mon Jan 29, 2007 4:47 pm

Re: strange behaviour of the <head>-tag (CMSms v2.1.2)

Post by Jo Morg »

so what? wrote: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.
No bug. It's as designed.
You need to understand how CMSMS parses page templates and that you can remove both < head > </ head > but not just one of them as it's not valid HTML in any case.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Post Reply

Return to “CMSMS Core”