In "Article" content type i have three view mode in "Manage Display" namely "teaser", "default" and "abc".

Similary in "Comment Display" i have two view mode namely "defalut" and "xyz".

Eg: When i see "abc" node page where i am listing comments, that time the comment should be display with my "xyz" view mode not the "default" one.

function custom_node_view($node) { return node_view($node, 'abc'); }

  • @Rupesh kindly check the updated info and do the needful Jun 16, 2015 at 12:11

1 Answer 1


You could use hook_entity_view_mode_alter() to switch it on the fly.

  • Thanks for the answer, currently i am using this hook only, i am looking is their any better solutions for this. Jun 29, 2015 at 10:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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