How to programmatically check a view to test if it has any results?
What’s the most lightweight way to test if a view has any results in it or not? I have a system which creates links to various views, but if the view has no results I want the link to be greyed out. I can only think to load the whole view and execute it, but hopefully there is an easier solution?
I should also note that these views contain contextual filters, if it makes any difference.
This article was republished from its original source.
Pixeldust is a 20-year-old web development agency specializing in Drupal and WordPress and working with clients all over the country. With our best in class capabilities, we work with small businesses and fortune 500 companies alike. Give us a call at 1(800)730-2416 and let’s talk about your project.