Drupal Views rewrite link dependent on boolean value I have a view that has a boolean field in it and a field that links to a file.  I want to use the boolean field to where if it is checked, it will direct to a static link, regardless of what file is uploaded.  If it is unchecked and there is no file, I want it to output nothing.  If it is unchecked and there is a file, then output the file link.  I tried setting up Views PHP and setting this up there, no luck.  First question is does Views PHP recognize rewrite rules that you've established in other fields, and if not, how can I accomplish this?  Below is the code I tried in Views php.  All it does is output the node id for every entry.

&lt;?php
  if($row-&gt;field_booleanval) {
    echo '&lt;a href="http://www.example.com"&gt;Link&lt;/a&gt;';
  }
  else if(!($row-&gt;field_booleanval) &amp;&amp; !($row-&gt;field_file)) {
    echo ' ';
  }
  else {
     echo $row-&gt;field_file;
  }
?&gt;
I finally got it to work as follows:

PHP field, Value Code:

return $data-&gt;field_field_booleanval[0]['raw']['value'];


Output Code:

&lt;?php
  print_r($value);
?&gt;


This returns the correct VALUE for the boolean field. So you can skip the Value Code unless you plan on using the variable elsewhere, and output could look something like:

&lt;?php
  $booleanval = $data-&gt;field_field_booleanval[0]['raw']['value'];
  $fileval = isset($data-&gt;field_field_file[0]); // shouldn't be set if no value

  if($booleanval) {
    echo '&lt;a href="http://www.example.com"&gt;Link&lt;/a&gt;';
  }
  else if(!$booleanval &amp;&amp; !$fileval) {
    echo ' ';
  }
  else {
     echo $row-&gt;field_file;
  }
?&gt;