| 1 |
<?php
|
| 2 |
// $Id: views-view-field.tpl.php,v 1.1 2008/05/16 22:22:32 merlinofchaos Exp $
|
| 3 |
/**
|
| 4 |
* This template is used to print a single field in a view. It is not
|
| 5 |
* actually used in default Views, as this is registered as a theme
|
| 6 |
* function which has better performance. For single overrides, the
|
| 7 |
* template is perfectly okay.
|
| 8 |
*
|
| 9 |
* Variables available:
|
| 10 |
* - $view: The view object
|
| 11 |
* - $field: The field handler object that can process the input
|
| 12 |
* - $row: The raw SQL result that can be used
|
| 13 |
* - $output: The processed output that will normally be used.
|
| 14 |
*
|
| 15 |
* When fetching output from the $row, this construct should be used:
|
| 16 |
* $data = $row->{$field->field_alias}
|
| 17 |
*
|
| 18 |
* The above will guarantee that you'll always get the correct data,
|
| 19 |
* regardless of any changes in the aliasing that might happen if
|
| 20 |
* the view is modified.
|
| 21 |
*/
|
| 22 |
?>
|
| 23 |
|
| 24 |
<?php $data = $row->{$field->field_alias} ?>
|
| 25 |
|
| 26 |
<?php if (!file_exists($data)): ?>
|
| 27 |
<?php $data = "sites/default/files/no-picture-150.jpg" ?>
|
| 28 |
<?php endif; ?>
|
| 29 |
|
| 30 |
<?php $imgpath = base_path().$data ?>
|
| 31 |
|
| 32 |
<?php print theme('imagecache', 'uc_thumbnail', $imgpath, 'alt text', 'title text'); ?>
|