I use below code to embed view in to a node, it works perfectly

<?php

$block = block_load('views', 'block_name');      
$output = drupal_render(_block_get_renderable_array(_block_render_blocks(array($block))));        
print $output; 
?>

Now how do I pass 'CONTEXTUAL FILTERS' to this view?

Comments

Anandyrh’s picture

any idea..?

merlinofchaos’s picture

Status: Active » Fixed

If you're using that method, via block_load, you'd need to set your contextual filter values in $_GET, which is a global variable representing the query string. Then Views will read them. Note that you could overwrite filters the user intended to set so you might test the variables before you set them.

Anandyrh’s picture

some one plz.. let me know how to pass contextual filters to embedded view in D7.

ksenzee’s picture

You might look into http://drupal.org/project/eva instead of embedding PHP into a node. It has built-in support for contextual filters.

Anandyrh’s picture

EVA module sounds simple, but I don't understand what to do with it... I don't see any options on the content or content type configuration pages.. :(

dawehner’s picture

It's a bit confusing but you configure the appearance on the field display configuration (not in views itself).

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

tce’s picture

How can I set the required $_GET variables?