Re: [SMARTY] sub-template problem with cache

From: Date: Wed, 08 May 2002 23:59:36 +0000
Subject: Re: [SMARTY] sub-template problem with cache
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-4105@lists.php.net to get a copy of this message
Your insert functions need to return data, not echo it. That might be your problem. k wrote:
I have made a page with 3 parts: head.tpl body.tpl foot.tpl /The header has 1 {insert}, the body has several others, the footer is static./ In the php file i have: $Smarty->display(body.tpl,$QUERY_STRING), an so the body.tpl looks like this: {include file="head.tpl"} blablabla ... {include file="foot.tpl} If cache is ON, than the three parts are displayed in wrong order: body head foot (So, it looks a bit funny...;) If cache is off, than the page is ok. So what could be the problem? What kind of effect cache has on the order of displaying the template parts, file includes? /I have several {insert}s in the body.tpl, where I allways use "if is_cached", if that matters/ BTW, I have the same (bad) result, if I do it like this: $SM->display('head.tpl',$QUERY_STRING); $SM->display('body.tpl',$QUERY_STRING); $SM->display('foot.tpl',$QUERY_STRING); I use the latest Smarty release. TIA, k


« previous php.smarty.general (#4105) next »