How to pass a variable or object to new block template or child block?

#1
Hello, I used:
Hole-punching Dynamically Created Blocks From A Template
For create a private block and I want to send a variable to created block like this:
$litemage_attr = array('litemage_dynamic' =>
array('tag' => 'wishlistGroup', 'access' => 'private', 'type' => 'wishlist/wishlistGroup',
'template' => 'wishlist/wishlistGroup.phtml'));
$this->getLayout()->createBlock('wishlist/wishlistGroup', 'wishlistGroup',
$litemage_attr)->setProduct($_product)->setTemplate('wishlist/wishlistGroup.phtml')->toHtml();
But I couldn't, please help me.
Also I used this:
$this->getChild('wishlistGroup')->setProduct($_product);
echo $this->getChildHtml('wishlistGroup',false);
But this is not work too.
 

Lauren

LiteSpeed Staff
Staff member
#2
currently dynamically created blocks do not take other params than template.
You can create a ticket and send me your server ssh login, we can try to figure out a solution. There will be customized code involved.
 
Top