When running the code...

<pre>
<?php
$view = views_get_view(allposts);
$view->execute();
print_r($view->result);
?>
</pre>

The result from the views custom field is not shown.

Comments

Anonymous’s picture

Component: User interface » Code

Apparently this issue is also causing the problem in this issue: #573390: Custom text values don't work
Any update on this?

infojunkie’s picture

Instead of calling $view->execute(), call $view->render(). The $view->result array should be updated then. The problem is that Views does not have a post-execute hook where VCF would be able to compute the field values. Hence, this computation can only occur at pre-render time.

Note that this technique currently works only for the PHP Custom Field. If you report that it works well, I can extend it to Markup and Rownumber.

casey’s picture

Drupal 7 version (http://drupal.org/project/views_php) updates $view->result.