[SOLVED] UDT params
Posted: Mon Jun 01, 2009 10:04 am
Hello,
I am having some problems getting the information I want passed through to my UDTs.
I need to be able to pass information which is generated in smarty tags in the template through to a UDT
for example
I am using the products manager module which is working fine. On the category page there is the grid of products and I want to add a UDT into the template which will display a different button depending on the products attributes.
To do this I need to pass the value of {entry->id} into my UDT {button1 id="?????"} is there a way to do this?
thanks
Rachael
/*edit*/
I found the solution whilst reading a totally unrelated forum post!!
add {assign var='product_id' value=$entry->id} into the template just before you call the UDT then in your UDT use
$smarty =& $gCms->getSmarty();
$text = $smarty->get_template_vars('product_id');
I am having some problems getting the information I want passed through to my UDTs.
I need to be able to pass information which is generated in smarty tags in the template through to a UDT
for example
I am using the products manager module which is working fine. On the category page there is the grid of products and I want to add a UDT into the template which will display a different button depending on the products attributes.
To do this I need to pass the value of {entry->id} into my UDT {button1 id="?????"} is there a way to do this?
thanks
Rachael
/*edit*/
I found the solution whilst reading a totally unrelated forum post!!
add {assign var='product_id' value=$entry->id} into the template just before you call the UDT then in your UDT use
$smarty =& $gCms->getSmarty();
$text = $smarty->get_template_vars('product_id');