|
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 |
kroimon Smarty n00b
Joined: 03 Nov 2011 Posts: 1
|
Posted: Thu Nov 03, 2011 10:19 pm Post subject: Modifiers for $smarty.block.child |
|
|
Hi,
why isn't it possible to use modifiers on $smarty.block.child?
The only way this variable is recognized is in this single form:
Code: | {$smarty.block.child} |
but you can't use this var like this:
Code: | {$smarty.block.child|replace:'foo':'bar'} |
|
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Fri Nov 04, 2011 9:41 am Post subject: |
|
|
{$smarty.block.child} is not a real variable.
Template inheritance is a compile time process and {$smarty.block.child} and {$smarty.block.parent} are palceholders for the corresponding source content.
To run a modifier on it's content put capture tags around it.
Code: | {capture name='foo'}{smarty.block.child}{/capture}
{$smarty.capture.foo|replace:'foo':'bar'} |
|
|
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
|