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.
Comment | File | Size | Author |
---|---|---|---|
#4 | display_tag-1346548-4.patch | 4.21 KB | helior |
#3 | display_tag-1346548-3.patch | 4.84 KB | helior |
#1 | display_tag-1346548-1.patch | 4.82 KB | helior |
Comments
Comment #1
helior CreditAttribution: helior commentedAnd here's the patch.
Comment #2
helior CreditAttribution: helior commentedComment #3
helior CreditAttribution: helior commentedRealized I messed up on the theme suggestion pattern.
Comment #4
helior CreditAttribution: helior commentedRe-rolled for updates in 3.0 release.
Comment #5
tim.plunkettTriggering the testbot.
Comment #6
lathanSmall 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".