I need add a footer to a view based on certain conditions. I followed this article and as per my understanding this should work. But this is not giving me any result.
Here is my code:
function utility_views_pre_view(ViewExecutable $view, $display_id, array &$args) { $item = array( 'id' => 'area_text_custom', 'table' => 'views', 'field' => 'area_text_custom', 'relationship' => 'none', 'group_type' => 'none', 'admin_label' => '', 'empty' => NULL, 'tokenize' => NULL, 'content' => array( 'value' => "Footer content is great.", 'format' => "basic_html", ), 'plugin_id' => 'text', ); $view->setHandler($display_id, 'footer', 'area_text_custom', $item); }
Update: Using the above hook the footer is getting called but renders as Array
based certain conditions
like what?