|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Rikaelus Smarty Rookie
Joined: 25 Feb 2005 Posts: 14
|
Posted: Fri Feb 25, 2005 1:03 am Post subject: Caching issue with variables passed during include |
|
|
As the name suggests I'm having issues with proper content coming up with caching and passed variables during includes being the primary factors.
Here's the structure:
- index.tpl (fetched by PHP and cached)
-- blockSec1.tpl (included by index.tpl if conditions met)
--- {blockContent id="(id)"} function called w/ static variable (A)
--- rightBlock.tpl (included by blockSec1.tpl, passing id variable
---- {blockContent id="$id"} function called w/ passed variable placed (B)
blockContent goes to a PHP function which then adds in a template which is no-cache, so it should refresh individually regardless of index.tpl's caching.
The Problem:
When blockContent is given the static variable (A) it works great. However it only works correctly through the include (B) when the main index.tpl cache is refreshed.
Reason:
It doesn't "include" rightBlock.tpl with a replacement for $id when cached. My PHP function is called via blockContent but with no variables passed.
Solution:
I need it to remember each included instance of rightBlock.tpl, each one remembering what to put into $id.
Thoughts of how to get around this? Yes I could stick strictly with the method done in "A" but method "B" allows for common design to be wrapped around the inside content without explicitely writing it on every instance.
Any help is appreciated. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|