It is possible to tag an entire view, however, it is currently not possible to tag an individual display within a view to distinguish that it's a part of a sub-group. For instance, some displays in a view can serve as a "preview", while other displays are "full-view". Having the display tag of "preview" could allow us to conditionally preprocess certain variables, execute certain code in views hooks, or provide an additional template suggestion so all "preview" displays can share a template.

I provided a patch that:
- Adds 'display_tag' in option_definition(), options_summary(), and options_form().
- Adds an autocomplete path/callback for existing display tags from within that view.
- Adds a template suggestion for the display_tag that takes precedence over the view tag.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

helior’s picture

FileSize
4.82 KB

And here's the patch.

helior’s picture

Status: Active » Needs review
helior’s picture

FileSize
4.84 KB

Realized I messed up on the theme suggestion pattern.

helior’s picture

FileSize
4.21 KB

Re-rolled for updates in 3.0 release.

tim.plunkett’s picture

Triggering the testbot.

lathan’s picture

Status: Needs review » Needs work
+++ b/theme/theme.incundefined
@@ -23,6 +23,12 @@ function _views_theme_functions($hook, $view, $display = NULL) {
+    }    ¶

Small white space issue.

While I like the concept of tagging a view and having addition hooks to process the subset, im not totally sold on more templates, also these would need to be integrated into the template suggestion section "Theming information".