$view = Views::getView('irsjg_homepage_slicks'); if (!is_object($view)) { return; } $view->setDisplay('block_home_video_slider'); $view->preExecute(); $view->execute(); $view->element['#attached']['library'][] = 'irsjg_home/video_slider'; $rendered = $view->render(); $output = \Drupal::service('renderer')->render($rendered); return [ ['#markup' => $output] ]; // orrrrrrrrrrr $view = Views::getView('irsjg_homepage_slicks'); if (!is_object($view)) { return; } $view->setDisplay('block_home_video_slider'); $view->preExecute(); $view->execute(); $view->element['#attached']['library'][] = 'irsjg_home/video_slider'; $content = $view->buildRenderable('block_home_video_slider'); return $content;
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter