I figured out how to du this seperatly
Display the user attribute:
<?php
//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
echo $value;
?>
Display page owner:
<?php
$ownerID = $cobj->getCollectionUserID();
$uia = UserInfo::getByID($ownerID);
$ownerName = $uia->getUserName();
echo $ownerName
?>
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
Thanks
After moving a little bit more around with the codes. i figured out that i just needed to move the
$cobj->getCollectionUserID();
into
$ui = UserInfo::getByID($u->getUserID());
So the finished code:
<?php
//Creat a UserInfo object with the Owner
$ui = UserInfo::getByID($cobj->getCollectionUserID() );
//Get the Value of your user Attribute
$value = $ui->getAttribute('name');
//Print it out
echo $value;
?>