0

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?

apaderno
  • 28,547
  • 16
  • 75
  • 90
  • (a) did you tried to put template file in your module directory? – IcanDivideBy0 Aug 16 '10 at 11:46
  • I did try. Added it there and to the module_theme hook. Didn't seem to work (ie) from the Views UI, when I go to Theme Information and click Rescan Template Files, the template file doesn't get picked up. It only does when it is in the theme folder. – Amarnath Ravikumar Aug 18 '10 at 05:26

1 Answers1

1

(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.

Matt V.
  • 9,703
  • 10
  • 35
  • 56