Probably the problem is trying to implement the preprocess function based on the same naming pattern that is used to override the pattern. But the functions of the preprocess differ in different ways from each other, they can be implemented only on the basis of the name of the base template and do not have the same mechanism for "specific" versions based on the sentences of the templates. For more details, see My answer to a more general question .
So, you will need to return to the implementation of the preprocess function of the database and check whether it is called for the desired view (and optionally) inside this function like this:
function [yourThemeName]_preprocess_views_view(&$vars) { $view = $vars['view']; if ('videos' == $view->name) { // Add desired manipulations for all 'videos' views if ('videos' == $view->current_display) { // Add desired manipulations for the 'videos' display only } } }
You can also add the expected behavior by implementing a general preprocess function that tries to call certain versions by checking functions with their own name - see the end of this article for an example, but this leads to rather complicated processing costs and makes sense only if if many views require special preprocess functions.
There are more βbasicβ preprocess functions for each type of view that can be implemented directly - see the list of template_preprocess_views_view_*
in "views / theme / theme.inc" for the available options.
As a basic rule, whenever there is a template_preprocess_*
function for a template_preprocess_*
, you can also implement the corresponding yourThemeOrModuleName_preprocess_*
function. If you need to manipulate templates based on sentences of the template name, you need to find the "base" name of the preprocess function, implement this and check your specific case in this function (for example, for a specific representation, as in the example above).
source share