The attached patch would make it possible for plugins to alter summary views as well as the full view. If you commit it (or something else that implements this kind of functionality since there may be better ways to do it) I have two plug-ins I can give you for the views bonus pack. One stacks a summary view above a full view to give you a display like the one described in http://drupal.org/node/74715 and another creates a nested tree taxonomy summary view as described in http://drupal.org/node/59646.
To implement a plugin that needs to manipulate the summary view, you just add 'alters_summary' => TRUE to the plugins items array. If this is set, the program bails out of the regular way of theming views and hands it off to the plugin. The plugin is then responsible for deciding whether it is dealing with a full or a summary view and responding accordingly.
The patch is needed because the current implementation won't involve the plugin if it is processing a summary view.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | views.module_19.patch | 1.54 KB | karens |
| views.module_18.patch | 1.13 KB | karens |
Comments
Comment #1
merlinofchaos commentedVery close -- I think I'd rather have the plugin information have 'theme' and 'summary_theme', and require all the existing plugins to point to the current summary theme. It's a slightly longer patch but it's more flexible and more self-documenting. Make that change and I'll happily commit it quickly.
Comment #2
merlinofchaos commentedWell, to ensure no API breakage I would allow plugins to default their summary themes to what currently exists, but I would still be explicit with the existing plugins.
Comment #3
karens commentedOK, here's what I came up with. I wasn't sure where was the best place to check that the new field has a value (so we don't break the API), but I ended up putting it in _views_get_style_plugins().
Comment #4
merlinofchaos commentedCommitted (I added some spacing, though you just copied what was already there which I committed before really being thorough last time).
Comment #5
(not verified) commented