process_whole_template true or false

General project discussion. NOT for help questions.
Post Reply
JeremyBASS

process_whole_template true or false

Post 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
studip101
Forum Members
Forum Members
Posts: 15
Joined: Wed Jun 13, 2007 8:31 am

Re: process_whole_template true or false

Post 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.
Jeff
Power Poster
Power Poster
Posts: 961
Joined: Mon Jan 21, 2008 5:51 pm
Location: MI

Re: process_whole_template true or false

Post 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.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: process_whole_template true or false

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
JohnnyB
Dev Team Member
Dev Team Member
Posts: 731
Joined: Tue Nov 21, 2006 5:05 pm
Location: OH, USA

Re: process_whole_template true or false

Post 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)
Last edited by JohnnyB on Sat Jan 16, 2010 5:43 am, edited 1 time in total.
"The art of life lies in a constant readjustment to our surroundings." -Okakura Kakuzo

--
LinkedIn profile
--
I only speak/write in English so I may not translate well on International posts.
--
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: process_whole_template true or false

Post 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
Last edited by Wishbone on Sat Jan 16, 2010 7:20 am, edited 1 time in total.
JohnnyB
Dev Team Member
Dev Team Member
Posts: 731
Joined: Tue Nov 21, 2006 5:05 pm
Location: OH, USA

Re: process_whole_template true or false

Post by JohnnyB »

thanks wishbone!
"The art of life lies in a constant readjustment to our surroundings." -Okakura Kakuzo

--
LinkedIn profile
--
I only speak/write in English so I may not translate well on International posts.
--
Post Reply

Return to “General Discussion”