Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

How do I edit a views field using preprocess before it is rendered to the screen? Let's say the field originally outputs something like this:

Note title

now I want to change that adding the number of comments in that node

Node title (4 comments, 1 new)

I know I can achieve this with joining two fields together or altering the template (tpl) files for that particular field but I'd like to learn how to use preprocess function in order to achieve this.

share|improve this question
add comment

1 Answer

There is help on Using default views in your module.

I also found this how-to helpful: Theming a view from within your module.

share|improve this answer
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.