HTML5 Header Tag Breaks Layout / Page [SOLVED]

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
User avatar
myshko
Forum Members
Forum Members
Posts: 102
Joined: Wed Feb 07, 2007 2:36 pm

HTML5 Header Tag Breaks Layout / Page [SOLVED]

Post by myshko »

Hi all,

Just a general query, not urgent.

I've been using HTML5 tags and cmsms seems to break when dealing with the <header> tag.

By break, I mean it won't render anything after the line the tag is inserted.

I'm using the latest cmsms core, 1.9.3 and it was a fresh install.

Has anyone else experienced this? I couldn't find many posts about it on the forum (in fact only this one http://forum.cmsmadesimple.org/viewtopic.php?t=46994)

But it didn't really help except confirm the cms doesn't like it.

I tried a few workarounds but couldn't seem to fix it.

Just thought I'd bring it up.

Thanks,

M
Last edited by myshko on Wed Mar 02, 2011 12:41 am, edited 1 time in total.
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: HTML5 Header Tag Breaks Layout / Page

Post by Wishbone »

Try changing 'process_whole_template' in your config.php from 'false' to 'true'

Code: Select all

$config['process_whole_template'] = true;
The default value (false) tells CMSMS to process the </__body> before the <head>.. The code is searching for '<head.*>'.. <header> matches this pattern as well and might be the reason for your issues.

This feature, (false) is so you can generate smarty variables in your content and use them later in the <head>. The most common use for this is for using the news title to be your <title>. You will lose this functionality by setting it to true.. It will read the entire thing at once.
User avatar
myshko
Forum Members
Forum Members
Posts: 102
Joined: Wed Feb 07, 2007 2:36 pm

Re: HTML5 Header Tag Breaks Layout / Page [SOLVED]

Post by myshko »

Wishbone,

Thank you very kindly sir!

Yes, setting 'process_whole_template' in the config to 'true' solved the issue.

Greatly appreciated, and such a quick response too.

Also, just in case anyone else is playing with HTML5 tags and has a similar issue, you can just switch them to divs with a class, and change your css.

So,

Code: Select all


<header>
	<hgroup>
		<h1> Main Heading</h1>
		<h2>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</h2>
	</hgroup>
</header>

Would become,

Code: Select all


<div class="header">
	<div class="hgroup">
		<h1> Main Heading</h1>
		<h2>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</h2>
	</div>
</div>

And you can just change your styles to suit. You can still use the shortened doctype / charset too.

Regards and best,

M
Post Reply

Return to “Layout and Design (CSS & HTML)”