I'm using Drupal 7. I'm creating a view based on profile. It will show a list of all the people. Now I'm overriding the file views-view-unformatted--MYVIEW-page.tpl.php and I would like to add in the class of the row the ID of that user. If I write
global $users;
$user->uid;
of course it's giving me the id of the current user and not the uid of that profile.
I would like to create something like this: FIRST EXAMPLE:
<?php
$this_uid = I NEED THIS TOKEN;
?>
<ul>
<?php foreach ($rows as $id => $row): ?>
<li class="<?php print $classes_array[$id]; print " ".$this_uid;?>">
<?php print $row; ?>
</li>
<?php endforeach; ?>
</ul>
I could create a custom text field in the view a put all the field inside the <li>
tag
like:
SECOND EXAMPLE:
<li class="[user]">[name] [gender]</li>
and the file tpl.php will become
<ul>
<?php foreach ($rows as $id => $row): ?>
<?php print $row; ?>
<?php endforeach; ?>
</ul>
But in this way I will lose the default row classes...
How can i get the first example? Do I need to create a view based on user instead of profile? Or should I use the second example?
Thanks in advance.