Page 1 of 1

[solved] how do we send Extra Page Attribute 1: to a UDT

Posted: Tue Nov 02, 2010 9:26 pm
by blackhawk
How do I automatically send the value of  "Extra Page Attribute 1:" on a content page, to a UDT and store it as a variable there?


Thanks!

Re: how do we send Extra Page Attribute 1: to a UDT

Posted: Tue Nov 02, 2010 10:20 pm
by Wishbone
Place the following in your UDT:

Code: Select all

$content_obj = $smarty->get_template_vars('content_obj');
$extra1 = $content_obj->GetPropertyValue('extra1');
$content_obj is a smarty variable that contains the object for your page, through it, you can access the extra1 property, among other things.

Re: how do we send Extra Page Attribute 1: to a UDT

Posted: Tue Nov 02, 2010 10:44 pm
by calguy1000

Code: Select all

{myudt myparam=$some_variable  myparam2='some_data'}
then inside the UDT:

Code: Select all

if( isset($params['myparam']) )
{
   // do some stuff here.
}

Re: how do we send Extra Page Attribute 1: to a UDT

Posted: Tue Nov 02, 2010 10:59 pm
by Wishbone
@calguy: I don't think he's asking how to pass user parameters to a UDT... He's asking how to access the extra1 property of the page from a UDT.

Re: how do we send Extra Page Attribute 1: to a UDT

Posted: Wed Nov 03, 2010 6:28 am
by blackhawk
Thank you wishbone, that is what i was looking for.  thats a big array - how could we live without it!  Thanks calguy for the extra tip too!