By admin, 16 October, 2024 Twig tweak: render views block with views title {{ drupal_block('views_block:VIEWSNAME-block_1', {'label': true} ) }} Tags twig views
By admin, 13 September, 2024 Add secondary tab to user local tasks Needs minimum 2 subtabs! custom.links.task.yml: Tags tabs views
By admin, 31 July, 2024 Set view title programmatically /** * Implements hook_views_post_render(). */ function MYMODULE_views_post_render(ViewExecutable $view) { if ($view->element['#view_id'] === 'user_blog') { $title = 'test'; $view->setTitle($title); } } Tags views
By admin, 26 March, 2024 Render views block programmatically /** * Implements hook_ENTITY_TYPE_view(). */ function my_module_user_view(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display, $view_mode) { if ($display->getComponent('my_module')) { $view = Views::getView('my_module_block'); Tags block views render
By admin, 25 January, 2024 Delete view programmatically \Drupal::service('config.factory')->getEditable('views.view.VIEWNAME')->delete(); Tags views
By admin, 2 August, 2023 Views with photoswipe slides not scroll Needs to add view global css class "photoswipe-gallery" Tags photoswipe views
By admin, 28 July, 2023 Hide an exposed filter block if the view results are empty /** * Implements hook_views_pre_render(). */ function mymodule_views_pre_render(ViewExecutable $view) { if ($view->storage->id() == 'myview' && $view->current_display == 'block_1') { if (empty($view-> Tags views exposed form