Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Modifiers for $smarty.block.child

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Feature Requests
View previous topic :: View next topic  
Author Message
kroimon
Smarty n00b


Joined: 03 Nov 2011
Posts: 1

PostPosted: Thu Nov 03, 2011 10:19 pm    Post subject: Modifiers for $smarty.block.child Reply with quote

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
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Fri Nov 04, 2011 9:41 am    Post subject: Reply with quote

{$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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Feature Requests All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP