Page 1 of 1

process_whole_template true or false

Posted: Tue May 19, 2009 6:21 pm
by JeremyBASS
Hello, I couldn't find anything really in the site on this and was just wondering what others had to say...

What are the pros/cons for setting $config['process_whole_template'] to true or false?

so far testing shows me that  $config['process_whole_template'] =false;  seems to slightly do better in time but not by much...

$config['process_whole_template'] =true;



$config['process_whole_template'] =false;




So what are the gains for going on way or another... (figured this could be put in the wiki as it's not there either)

Can't wait to hear what’s what on this...

Cheers
Jeremy

Re: process_whole_template true or false

Posted: Mon Oct 26, 2009 5:49 am
by studip101
With process_whole_template set to true, the template is processed at once, as opposed to creating a template for the html section and another one for the section and processing them individually. The biggest effect I noticed was that, with process_whole_template set to false, the section is processed first, meaning that smarty variables assigned in the of your html aren't available when the body section is being processed (very annoying and counter-intuitive). Other than that, I'm not sure what advantages/disadvantages there are.

Re: process_whole_template true or false

Posted: Mon Oct 26, 2009 6:05 am
by Jeff
The biggest advantage that I know of. Is that you can set the page title to include Blog/News Titles for better SEO.

Re: process_whole_template true or false

Posted: Mon Oct 26, 2009 2:10 pm
by calguy1000
The process_whole_template thing will probably be removed, and OFF by default from 2.0 onwards.

What it does when OFF is divide the page template into two distinct sections:
a) the body
b) the head

The body part is processed through smarty first.  This allows modules to set smarty variables that can be used in the head, for things like canonical urls, meta description tags, etc, etc.    Next the head part is processed through smarty, and then the results are glued back together before output.

I would recommend that everybody have this set to FALSE in their installs, and if they've done hacks to achieve the above (meta description, title, and canonical urls) another way, un-do them.

Re: process_whole_template true or false

Posted: Sat Jan 16, 2010 5:38 am
by JohnnyB
Hi,

I'm trying to figure out where the CMSMS determines the start point and end point of each section.  Is it using HTML tags to determine the starting point or smarty {metadata} and {content} tags for example?


I read this which answers my question (I think):
* We split the template into three pieces
    a) Any text ontop of
    b) The section
    c) the rest of the template (the body)

Re: process_whole_template true or false

Posted: Sat Jan 16, 2010 7:18 am
by Wishbone
mww wrote: I'm trying to figure out where the CMSMS determines the start point and end point of each section.  Is it using HTML tags to determine the starting point or smarty {metadata} and {content} tags for example?
It's using the HTML tags to determine the parts. First, everything above the is processed, then between and , then between and . The code that determines which order the sections are processed is in /index.php and the method of how the sections are retrieved is in /lib/content.functions.php

Re: process_whole_template true or false

Posted: Sat Jan 16, 2010 7:53 am
by JohnnyB
thanks wishbone!