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');
[SOLVED] UDT params
-
- Forum Members
- Posts: 57
- Joined: Thu Jan 17, 2008 3:58 pm
[SOLVED] UDT params
Last edited by rlparker25 on Mon Jun 01, 2009 10:30 am, edited 1 time in total.
Re: [SOLVED] UDT params
Have you read UDT documentation?rlparker25 wrote: To do this I need to pass the value of {entry->id} into my UDT {button1 id="?????"} is there a way to do this?
Pass your variable in tag (ex: {button1 product_id="yyy"}) and use $params['xxx'] in UDT (ex: $params['product_id'])
Alby