On my site I use Views and Display Suite, sometimes together, sometimes separately.

In on of my Display Suite layouts, I have a certain field displayed and the field itself is modified by a function


Using Display Suite, it works fine. Now on another page on my site, I am trying to display the same field using a Views page view. The field is specified in the view, but the preprocess function is not being called.

Do you think it has to do with the fact that I have this in a custom module file:

* Implements hook_views_api().
* Enabling using templates inside module
function mycustom_views_api() {
  return array(
    'api' => 3,
    'path' => drupal_get_path('module', 'NAME'),
    'template path' => drupal_get_path('module', 'NAME'),

I am trying to avoid putting any custom files in my theme folder because it doesn't make sense (what if I want to change themes?). So I need a way for all my custom stuff to work as a module.


  • I removed above code and put the views template files back in the theme templates folder. Still doesn't work. I don't understand why Views would not call the preprocess_field function if Display Suite calls it... – Brian Huether Oct 5 '15 at 18:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.