Display user attribute
I figured out how to du this seperatly
Display the user attribute:
//Create a User object (of the current User)
$u = new User();
//Creat a UserInfo object with the user ID
$ui = UserInfo::getByID($u->getUserID());
//Get the Value of your user Attribute
$value = $ui->getAttribute('name');
//Print it out
Display page owner:
$ownerID = $cobj->getCollectionUserID();
$uia = UserInfo::getByID($ownerID);
$ownerName = $uia->getUserName();
But i cannot figure out how to put them together so it displays the attribute('name'); of the page owner
Can you guys please help
$ui = UserInfo::getByID($cobj->getCollectionUserID());
I know how to display a custom attribute for a page. Now I am trying to figure out how to display a user attribute.
More specifically, I want to use a page attribute to define which user's attributes are being displayed.
But first things first... I just want to get a user attribute to show up on my site.
Here is a link to my site:http://advising.terry.uga.edu/index.php/accounting/...
See the empty blocks in the sidebar? That's where I want user information to show up. See the blocks below with contact information? That's just regular ol' content blocks. I want to automate this content based on user attributes.
Thanks for any helpful suggestions!
Did you ever figure this out?
I have also been pondering how to display one of the page owners user attributes..
i.e. The page Owner has several user attributes such as his membership number, i can figure out to get the page owners ID but how to use that to display one of his own attributes on his members page is eluding me..
$c = Page::getCurrentPage(); $uID = $c->getCollectionUserID(); $ui = UserInfo::getByID($uID); print $ui->getAttribute('membership');