Page 1 of 1

get parameters from UDT

Posted: Fri Jul 11, 2008 10:33 am
by perlman123
Hello,  how can i get parameter from UDT to content page? In page i wrote some JS code which needs some links from php code at user defined tags...

Re: get parameters from UDT

Posted: Fri Jul 11, 2008 2:57 pm
by Nullig
Just assign the value to a variable and use:

return $variable;

in your UDT.

Nullig

Re: get parameters from UDT

Posted: Fri Jul 18, 2008 4:28 pm
by Augustas
Here is the full code how to do it.
in UDT:

Code: Select all

$yourvar = 'text';

global $gCms;
$smarty = &$gCms->GetSmarty();
$smarty->assign('mytitle', $yourvar);
Then in your template after UDT is called, you can get your new variable by printing

Code: Select all

{$mytitle}