I have two fields, one is a taxonomy author field, and the other is a cck text field to denote the organization a person works for.

I would like to print these, on the same like so "By John Smith | Public Broadcasting".

Sometimes there will be no author field, and other times there will be no organizational field. So I need to print the " | " conditionally if both values are not empty.

So some times the byline may appear "By John Smith". Other times it may appear as "Public Broadcasting" And if both fields are not empty it would display as "By John Smith | Public Broadcasting".

I have been using the following code, but obviously this way the pipe appears if there is an organization field, regardless of the existence of an author taxonomy term.

 <div class="field-field-author">
           print author_taxonomy_output($node);
           if ($node->field_paper[0]['safe'] != '') {
           echo "  |  " .$node->field_paper[0]['safe'];

Any ideas how I can pull this one off?