I'm trying to render the rows in a view manually using the Views API. The style plugin is the "Unformatted" plugin. This is my code:
<?php
$view = views_get_view('nearme');
$view->execute('default');
$view->preview();
$renderer = $view->style_plugin->row_plugin;
foreach ($view->result as $row) {
echo $renderer->render($row);
}
?>
This code almost works - it renders essentially a blank row. My "Global: custom text" field is rendered, as are some generic labels and field HTML, but the actual values from $view->result are not interpolated.
What am I doing wrong?