Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.11
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Sep 2009 at 12:03 UTC
Updated:
15 Sep 2010 at 22:50 UTC
Jump to comment: Most recent file
Comments
Comment #1
dawehnerThats easy :)
The display id has always an numeric parameter, so the first block display is 'block_1'.
Views uses execute_display on quite important places, it should work :)
Comment #2
tayzlor commentedaaah, doh! brilliant thanks =) closing this.
Comment #3
geshan commentedexecuting a block display returns an array so print or return $output['content'];
Comment #4
sagannotcarl commentedDoes anyone have an example of this for panel panes?
I'm calling the following and it still returns the default display.
replacing pane_3 with panel_pane_3 isn't working either.
I am using this somewhere else calling a views context pane and using init_display('ctools_context_1') and execute_display('ctools_context_1') worked great. I just can't figure out how to call a panel pane in this way.
Comment #5
merlinofchaos commentedYou should do a dsm on array_keys($view->display) to make sure you're using the right ID. THat is the most likely problem. 'pane_3' is definitely not right.
Comment #6
sagannotcarl commentedThanks for the tip.
dsm(array_keys($view->display)) returns panel_pane_3 (along with the other displays - see screenshot). But putting that into the execute_display still doesn't work.
Here is some more info:
* Using $view->execute_display('pane_3') returns the default display
* Using $view->execute_display('panel_pane_3') returns nothing
Any other suggestions for troubleshooting?
Comment #7
merlinofchaos commentedYou probably want $view->preview() not $view->execute_display() now that I think on it. I forget what execute_display() will get you on a panel pane, but preview() is guaranteed to always get you rendered output. execute_display() gets you whtaever the display thinks is appropriate (i.e, an array for a block, etc).
Comment #8
sagannotcarl commentedPerfect! Thanks so much!