<?php drupal_set_message('<pre>' . var_export($row, true) . '</pre>'); ?>And it produced this output:
array ( 'nid' => '97', 'title' => 'Scisco Ideo Vicis Feugiat Qui', 'name' => 'luwrepuslan', )My view had three fields:
Node: Nid Node: Title User: NameThe contents of the $row variable included these fields, in precisely the order that I had arranged them to using the Views rearrange link. Also worth noting, though, is that each field also has an identifier so it can easily be pulled out of the row should I want to display it differently. Using
<?php print $row['title']; ?>Would print just the title for that row. Please remember that I'm doing this inside the loop, so this will get repeated for every row of the view. The IDs used to fetch items from the array, id $row['title'] can be quickly and easily looked up on the Theme: Information page. Once a field has been added to the view, its ID will not change, but note that if there are two "title" fields in a view, one will be 'title' and the other will be 'title_1', in order to prevent namespace collisions. The important thing here is that Views does provide IDs. Views doesn't tell you what these IDs are, but it's easy to get them by dumping the row data and doing a simple visual inspection. Views does guarantee that these IDs will not change, unless you actually add a new field and remove the existing one (in which case 'title', above, would become 'title_1').
<?php print $fields['some_id']->content; ?>Assuming you replace some_id with an id found on the theme: information page, this code will print the content for that field. You can also get the label and some other data about the field, as well as the raw information. Complete details for what is available are documented directly in views-view-fields.tpl.php. Keep in mind that if you rewrite your templates using this, you'll need to maintain this template whenever changes are made to the fields of the view; while this isn't generally recommend, sometimes it's necessary to get the kind of control you might ultimately need.