I have a view that calls for Show: Content, using a very specific view mode (neither Full content nor Teaser, it's created on purpose and themed according to my needs, basically an e-mail oriented output with very different HTML classes than the usual views displays in Drupal). When used in a page, it renders perfectly. However, when I render it from code to be able to use the resulting HTML directly:
$view = Views::getView('view_id'); $view->setDisplay('default'); $view->setArguments($args); $view->preExecute(); $view->execute(); $render = $view->render(); $html = render($render);
I get an otherwise perfect render but not with that view mode, just the usual stuff. Alternative calls do the same:
$render = $view->buildRenderable('default', $args); $html = render($render);
How could I force it to render the way I want it?