Closed (fixed)
Project:
Views (for Drupal 7)
Version:
7.x-3.1
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
18 Jan 2012 at 10:56 UTC
Updated:
9 Aug 2012 at 13:49 UTC
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
Comment #1
Anandyrh commentedany idea..?
Comment #2
merlinofchaos commentedIf 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.
Comment #3
Anandyrh commentedsome one plz.. let me know how to pass contextual filters to embedded view in D7.
Comment #4
ksenzeeYou might look into http://drupal.org/project/eva instead of embedding PHP into a node. It has built-in support for contextual filters.
Comment #5
Anandyrh commentedEVA 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.. :(
Comment #6
dawehnerIt's a bit confusing but you configure the appearance on the field display configuration (not in views itself).
Comment #8
tce commentedHow can I set the required $_GET variables?