I currently have a very large set of Views that I am refactoring. These views work with a set Taxonomy and pull in the content that links to that Taxonomy. However the work that I am doing in the refactoring is going to result in the following necessities, when the Taxonomy gets added/updated by the user, and there is a new View catering to the content that uses it:
- Dynamically modifiable Taxonomy values
- New path
- New Global Text
- New Views Block that acts as a Tally counting the usage
Removal of the Views when the Taxonomy item is deleted, without affecting the others in its group.
So what do you think I should be looking at to accomplish this?
Hooks or handlers?
Or ditch Views altogether, and only use it to help get the correct SQL in the mockup phase?
It's a bit tricky to know based on your broad description.
These suggest hooks to me:
This suggests a Views field handler to me:
And this suggests "ditch Views" to me IF for some reason can't be accomplished by a Views block:
Personally, I've used new Views handlers when I need to create special filters, for example, that look up a global variable to filter by an entity's field value, or when I need a very specific way of sorting the query, or displaying the results of a field. Also, to avoid using the same Global text field in different views (think of creating a link to edit a custom entity listed in a view).
I have used different Views hooks to load special Javascript or css files, to loop through the results and make changes before they are displayed. I try to stay away from hooks that modify Views queries, as those are terribly complex, and it's just faster to do the queries myself with
db_select
and then display the results in the ways I want.I've ditched Views when queries are very complex that using a Views would get ridiculously difficult, when I need special treatments of the results that can't be provided by Views field rendering. In some of those cases I could have written a new Views plugin (which handles the display or query), but that would have been more work than just writing my own queries and handling the results in custom modules.