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

General project discussion. NOT for help questions.
Post Reply
blackhawk
Power Poster
Power Poster
Posts: 280
Joined: Mon Oct 20, 2008 6:07 pm

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

Post 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!
Last edited by blackhawk on Wed Nov 03, 2010 6:28 am, edited 1 time in total.
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

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

Post 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.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

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

Post 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.
}
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

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

Post 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.
Last edited by Wishbone on Tue Nov 02, 2010 11:03 pm, edited 1 time in total.
blackhawk
Power Poster
Power Poster
Posts: 280
Joined: Mon Oct 20, 2008 6:07 pm

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

Post 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!
Post Reply

Return to “General Discussion”