logo

Extra Block Types (EBT) - New Layout Builder experience❗

Extra Block Types (EBT) - styled, customizable block types: Slideshows, Tabs, Cards, Accordions and many others. Built-in settings for background, DOM Box, javascript plugins. Experience the future of layout building today.

Demo EBT modules Download EBT modules

❗Extra Paragraph Types (EPT) - New Paragraphs experience

Extra Paragraph Types (EPT) - analogical paragraph based set of modules.

Demo EPT modules Download EPT modules

Scroll

The function views_get_view_result is returning an empty array for some reason.

22/02/2025, by Anonymous (not verified)
Forums

Hello.

I created a view named view-last-news, which returns a list of the latest news.
In the view construction mode, the preview shows everything correctly.

I'm trying to read the information stored in this view using the function call views_get_view_result, and this function call is located in the file node-[node-type].tpl.php

I'm writing the following code:

$wr=views_get_view_result('view-last-news');
print_r($wr);

But for some reason, it returns an empty array

Array ( )

Moreover, when I created a block with this view, that block displays everything correctly.

Could you please tell me why the returned array is empty if this view is supposed to contain data?