Show a Display Suite view mode depending on a field value in the profile of the viewing user I'm not looking to use Views for this challenge here but simply to add a check for a value of a field on the viewing user's profile and then to select the correct view mode from Display Suite for that node depending on that value. What would I have to do to accomplish this?
Are you looking for code or just the approach? One approach would would be to use HOOK_entity_view_mode_alter(&amp;$view_mode, $context) in a custom module:


Check that the user is logged in
Check that the user is viewing the right kind of node
Load the user and get the profile field value
Based on the field value, set the view mode ($view_mode = 'custom')