Replacement pattern in view field template I have a body field view template:

&lt;?php

/**
 * @file
 * This template is used to print a single field in a view.
 *
 * It is not actually used in default Views, as this is registered as a theme
 * function which has better performance. For single overrides, the template is
 * perfectly okay.
 *
 * Variables available:
 * - $view: The view object
 * - $field: The field handler object that can process the input
 * - $row: The raw SQL result that can be used
 * - $output: The processed output that will normally be used.
 *
 * When fetching output from the $row, this construct should be used:
 * $data = $row-&gt;{$field-&gt;field_alias}
 *
 * The above will guarantee that you'll always get the correct data,
 * regardless of any changes in the aliasing that might happen if
 * the view is modified.
 */
?&gt;
&lt;?php print $output; ?&gt;


What I want is:

if nid == 1
print $output =  view_embed_view('my custom view')
else
print $output;


How can we do this?

Note: I'm already using the Views Field View module, but can't figure out as how to apply this condition of nid.
In view template file of body field, write this code;

$nid = $row-&gt;nid;
$body = $row-&gt;body;
if($nid == 1):
  $view = views_get_view('VIEWS_MACHINE_NAME');
  $view-&gt;set_display('DISPLAY_ID');
  $new_view = $view-&gt;preview('DISPLAY_ID');
  print render($new_view);
else :
  print $body;
endif;