1

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 – Azher Basha Jun 16 '15 at 12:11
0

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. – Azher Basha Jun 29 '15 at 10:24

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.