I have a view that needs to have a custom views footer only if it get results. Otherwise the view needs to not be displayed

I can set up a view footer by using $view->setHandler with hook_views_pre_render and I can count results with hook_views_pre_render

How can I achieve both with a single function? Using $view->setHandler with hook_views_pre_render does not attach the footer


Found an alternative solution, by using hook_views_pre_render and $view->attachment_after

$view->attachment_after = array('#markup' => '<a href="/" title="Title" class="button">Button</a>');
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.