Page 1 of 1

Calling a User Defined Tag from another one

Posted: Wed Jul 18, 2007 12:27 pm
by jsmonzani
Hello,

I love developing User Defined Tags and I'm wondering: is there a way to call a User Defined Tag (and pass parameters to it) within another one? Or to call smarty within a USD?

Thank you very much for your help!

Cheers

JS

Re: Calling a User Defined Tag from another one

Posted: Wed Jul 18, 2007 12:34 pm
by RonnyK
USD?

I found this topic on smarty in UDT.

http://forum.cmsmadesimple.org/index.ph ... l#msg60579

Ronny

Re: Calling a User Defined Tag from another one

Posted: Wed Jul 18, 2007 12:57 pm
by jsmonzani
Thank you Ronny, this surely helps!

I don't think that this really shows how to pass parameters, though, but I'll give it a try :)

Say if you have something like:

{myusd  param="42"}

how would this translate to PHP code? :)

Re: Calling a User Defined Tag from another one

Posted: Fri Jul 20, 2007 12:52 pm
by jsmonzani
Hm couldn't find this out. I'm sure somebody has already done it ;)

Re: Calling a User Defined Tag from another one

Posted: Fri Jul 20, 2007 1:31 pm
by scooper
You can call a UDT from inside another UDT using CallUserTag()

For example .... to pass the hat style of the day to my handy UDT 'hats' I would do:

Code: Select all


global $gCms;

$params['style']="boater";

$tagOps = $gCms->GetUserTagOperations();
$tagOps->CallUserTag("hats",$params);

s.