Using views PHP I created an output as follows:
<?php
if ($value) {
print $row->name;
print $row->view;
}
?>
where $value is always true for now (while debugging). The output I get is just from $row->name but not $row->view. Any idea on what I need to do?
Below are the available tokens as they are listed:
$view: The view object.
$handler: The handler object.
$static: A variable that can be used to store reusable data per row.
$row: Contains the retrieved record from the database (e.g. $data->nid).
$row->tid: Taxonomy term: Term ID
$row->name: Taxonomy term: Name
$row->view: Global: View
$row->php: Global: PHP
$data: Contains the retrieved record from the database (e.g. $data->nid).
$value: Value of this field.
Comments
Comment #1
reg commentedI should mention that the purpose of this is to only display $row->name when $row->view is not empty. Otherwise I can get a bunch of titles with no data under them.
Comment #2
damiankloip commentedCan you export your view? I will then take a look :)
Comment #3
reg commentedAttached first the view with the issue and 2nd the view being used as a field. The display is "pages-tmp".
Comment #4
reg commentedDid you manage to find anything on this issue?
Comment #5
damiankloip commentedHmm, not sure vfv will work for stuff like this. Is this view (second one) returning results ok normally? views_php will be working when the field is being rendered no? So the vfv field hasn't been processed yet.....?
Comment #6
reg commentedIt renders just fine when there is something to render, if you mean does it return some sort of code in a programming sense then how do I check that? (I am a programmer so I can do some checking but I don't have experience with programming views)
It works when I'm not using it's token but instead use it in the normal way.
Comment #7
alibama commentedwell this is exactly what i'm trying to do = apparently this field doesn't get processed until after the rest of the view is processed... am wondering whether there is some sort of workaround for this
Comment #8
damiankloip commentedDo you have query aggregation turned on? This may give you some joy, but maybe not. I haven't tried it. Alot of vfv processing is done in the render method on the field handler, so you wouldn't have this info available before hand.
Comment #9
damiankloip commentedI think this is a 'works as designed' as the view is built in the render stage, you won't have too much joy trying to use views php with it.