3

I have a view with some fields wich I theme inside views-view-fields--MYVIEW.tpl.php. I use a phptemplate_preprocess_views_view_unformatted__MYVIEW() to preprocess some $vars before the template to have the template as clean as possible. But I don't know the right way of preprocessing the fields.

I can access the fieldcontent in the template via $fields['MYFIELD']->content. Inside the preprocess function I can't find this explicit content value. All I see is something called last_render but i'm not sure it's ok (the right way) to use/change this value.

1

Try to use debug() to see the content of $vars. As far as I know, in views/themes/theme.inc there are many examples of preprocessing functions.

| improve this answer | |
1

Try dsm($vars). It allows you to see the contents of $vars clearly. Note that you need the Devel module to do this.

| improve this answer | |

Your Answer

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

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