0
votes

In my Views display, I want to link the node->title to the node->path unless the user has entered a URL into an optional CCK field. In that case, I want node->title to link to the URL.

I thought using a preprocess function to set the CCK field's value to node->path if empty was the answer, but I'm using Views Slideshow which uses fields. It's my understanding that preprocess functions only apply to .tpl files.

Any suggestions for achieving this functionality?

1
What version of Drupal/Views are you using?Clive
I'm use Drupal 6 and Views 2.user903277

1 Answers

0
votes

The answer was to use a field template and not a preprocesser. Here's what my field template looks like:

<?php
if (empty($output)) {
  $node = node_load($row->nid);
  $output = base_path() . $node->path;
}
print $output;
?>