Search code examples
drupaldrupal-6viewdrupal-themingdrupal-fields

Drupal Views - Custom Theme for a field


Two quick questions regarding custom theming of view fields in Drupal 6 -

(a) I know that we can include a custom theme for a view field in a appropriately named template file but I notice that it has to be placed in the theme folder.

However, I want this theme file to be bundled with my module and was wondering if it could be done somehow?

(b) Can we have a preprocess function to set custom variables before the field is themed?


Solution

  • (a) I suspect it will be difficult because of the limitations of preprocess functions. Depending on what you need to do, you might be able to use the hook_views_pre_render function.

    (b) Here are some tips on theming views with preprocess functions.