I'm right now using substr($view->current_display, 0, 4) == 'page' but I wonder if there is any way more elegant.