Closed (won't fix)
Project:
Panels
Version:
5.x-2.0-beta4b
Component:
Views panes
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
4 Jun 2008 at 21:47 UTC
Updated:
28 Dec 2008 at 20:22 UTC
I'm not sure if this is the best way to do it, but I needed to alter a view that was being displayed in a panel before the $nodes list is generated, normally done with the hook_views_alter* functions.
This patch adds a simple hook to alter panel_views before they are rendered...
Index: panels_views.module
===================================================================
--- panels_views.module (revision 14)
+++ panels_views.module (working copy)
@@ -808,6 +808,13 @@
$offset = ($pv->allow_offset) ? $conf['offset'] : $pv->offset;
$stored_feeds = drupal_add_feed();
+
+ //PATCH: Adds alter hook for customizing views before rendering.
+ foreach (module_implements('panels_views_alter') as $module) {
+ $function = $module .'_panels_views_alter';
+ $function(&$view, $panel_args, $contexts, $pv);
+ }
+
$block->content = views_build_view($pv->view_type, $view, $args, $pager_id, $
nodes_per_page, 0, $offset);
if (($pv->allow_feed_icons && !empty($conf['feed_icons'])) ||
| Comment | File | Size | Author |
|---|---|---|---|
| panels_views.module.patch | 738 bytes | jon pugh |
Comments
Comment #1
merlinofchaos commentedI'm sorry, you didn't explain why hook_views_alter itself isn't sufficient.
Comment #2
sdboyer commentedSorry, but we need to keep things with Panels moving. Unless I hear back on this in the next couple days, I'm going to won't fix it, as I also don't see any reason why hook_views_alter() isn't sufficient.
Also, no need to include comments in the patch itself indicating that it's a patch.
Comment #3
sdboyer commentedSorry, but we need to keep things with Panels moving. Unless I hear back on this in the next couple days, I'm going to won't fix it, as I also don't see any reason why hook_views_alter() isn't sufficient.
Also, no need to include comments in the patch itself indicating that it's a patch.
Comment #4
sun