Hide View if php-executed term is applied

Example of showing a View only for the Mobile version of website (through Mobile Detect)

  1. Contextual filter -> ADD: "Global:Null"

     
  2. Executing term of the rendering of a view

 
require_once 'sites/all/libraries/Mobile_Detect/Mobile_Detect.php';
          $detect = mobile_detect_get_object();
          $is_mobile = $detect->isMobile();


if ($is_mobile) {

 return $view;
             
}



 
Tags: