how can I get the node id through the : preprocess_views_view_fields()


You can get nid (node id) from $vars as like following:


You can also check the $vars to view the structure of the object as like following:


To use dpm(); you have to install devel module.

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.