I have a CB field "cb_companydescription", which is a relatively long description of each user. I would like to create a CB user list that involves a truncated version of this field, say the first 100 characters.
I created another CB field in which I read the cb_companydescription from API and then truncate the resulted output:
Code:
global $_CB_framework;
$vid = $_CB_framework->displayedUser();
//echo "disp userid $vid";
$cbUser = &CBuser::getInstance( $vid );
$cname = $cbUser->getField('cb_companydescription');
$sho = substr($cname, 0, 100) . "...read more.";
echo $sho;
Now this CB field works perfectly well if used inside CB profile, but when I try to use the field in my user list, $_CB_framework->displayedUser() always returns NULL.
Also, if I have a CB field with a substitution like this [cb:userdata field="username" user="#displayed" /], the field doesn't work in userlist.
1) Is there a way to use $_CB_framework::displayedUser() (or something similar) in a CB field that is used in a userlist?
or
2) Is there some other way to achieve what I'm trying to do?
I have the latest CB and Joomla 2.5.
thanks in advance