I am displaying a block on all /user pages, that will show all upcoming events, and the staff that have been assigned to certain roles at that event.
For example...
Manager: Jake
Bar Staff: Mike, Fred, Jim
Sound Tech: James, Bill
What I want to achieve, is for every instance of a users name to be highlighted in that view, if they are logged in. So, go to Bills user page, and all "Bill" entries have an "active" class applied to them. Then, go to Mikes user page, and all "Mike" entries are given the "active" class etc.
Usually, I would name a template field for the view field views-view-field--field-manager.tpl.php and do a comparison with the current user page title, which is the current users name...
<?php
$title = drupal_get_title();
if ($title == $output) {
$class = "active";
}
?>
<span class="<?php if(isset($class)) { print $class; } ?>"><?php print $output; ?></span>
But this is affecting the whole field, which is no good when you have multiple users referenced in the field.
Is there a way to target individual multiple results in a field with a tpl file?