Embed view and set filter from CCK field I created a view with 3 filters. I embedded the view in my tpl.php file for the content type. My question is, how can I set some filter with the value from a CCK field?

This is the code I use:

$view = views_get_view('view_name');
$view-&gt;set_display('default');
$view-&gt;filters[2]['value'] = $node-&gt;field_name[0]['value'];
if (!empty($view)) {
    print $view-&gt;execute_display($display_id , $view_args);
}
You should use arguments instead of filters on your view. That way you can use views_embed_view.

Just add an argument to the view with the same field you would use as a filter. That adds a where condition to the views query in a similar way as a filter would do.

Then pass on the CCK field value as the third argument on your template file like this:

print views_embed_view('view_name', 'default', $node-&gt;field_name[0]['value']);