-
dca tl_member.php
Code:
'label' => array
(
'fields' => array('firstname', 'lastname', 'username'),
'format' => '%s %s <span style="color:#b3b3b3; padding-left:3px;">[%s]</span>',
how for username = admin make this
<span style="color:red;">admin</span>
for example,
'format' => ''.$myuname = %s. ($myuname == admin) ... .'', :D
-
Re: dca tl_member.php
I think you'll need to use a label_callback (instead of format) to do this.
Code:
'label' => array
(
'fields' => array('firstname', 'lastname', 'username'),
'label_callback' => array('tl_whatever', 'labelformat')
Code:
public function labelformat($row, $label)
{
//whatever
return $label;
}
-
Re: dca tl_member.php
thanks for the answer
Code:
public function labelformat($row, $label)
{
$label = $this->fields->username;
return $label;
}
how to call a username?
$this->Member->username
$this->username
$GLOBALS['TL_DCA']['tl_member']['fields']['username']
how?
-
Re: dca tl_member.php
$row is passed into the function, so $row['username'] should work.
Code:
if(//whatever)
{
$user = '<span style="color:red;">' .$row['username'] . '</span>';
}else
{
$user = $row['username'];
}
//style label to suit
$label =
'<div class="limit_height h190 block">
' .$user .'
</div>';
return $label;
I'm not sure how you determine if user is admin (there might be an isAdmin???)
You can do imports, database calls and anything else you need to within the callback function.
-
Re: dca tl_member.php
thanks!
works!
member admin = $row['username'] == 'admin'
thats all
other checks do not need
this is only to highlight in BE