Tell me more ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

Omega theme has a singular way to add preprocess functions.

I need to add this preprocess function to be executed when a view is rendered:

function MyTheme_alpha_preprocess_views_view_fields(&$vars) {
...
}

This is what I've done (is not working, the dpm function doesn't print the message, no error is shown)

1) In sites/all/themes/MyTheme/preprocess/created the file preprocess-views-view-fields.inc

2) In preprocess-views-view-fields.inc I added the function:

   function MyTheme_alpha_preprocess_views_view_fields(&$vars) {
     dpm('hello');
    }

What am I missing?

share|improve this question
1  
Standard question: Have you cleared the cache since adding the file and adding the new preprocess hook? – Clive Dec 17 '12 at 14:11
@Jimajamma Omega lets you split out preprocess and process functions into separate include files. The base theme itself scans/includes/invokes them, and part of this is a slightly different naming convention to avoid clashes with putting the functions directly in template.php. – MPD Dec 17 '12 at 14:35
@clive: I cleared cache several times. – chefnelone Dec 17 '12 at 20:25
you put this function like this template_preprocess_views_view_fields(&$vars) in your template.php – Sathiya Dec 18 '12 at 6:27
I think that the problem is that I have Aggregation enabled in the view... – chefnelone Dec 19 '12 at 16:45
show 1 more comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.