Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By peterk900 on
I want to use a different display format ( hiding selected fields ) for a node when opened in a Colorbox pop-up from a specific View table record. I understand this is possible using hook_node_view and passing the view mode as a parameter - i.e.
function hook_node_view($node, $view_mode, $langcode)
Will this work ? And if so:
- How do I restrict the code to run only if called from a specific view ?
- What other code needs to go into the function ? If changes to fields are made in the view mode, is any other code required ?
Any help here much appreciated. Thanks.