I have a custom block that I created with Calendar2, which I have called "Upcoming Events." I would like to output this using a simple php snippet, but when i call views_get_view, I get an error that says the function is undefined. Am I doing this incorrectly, or is this function not available to Front Page?

Comments

Phillip Mc’s picture

Assigned: Unassigned » Phillip Mc
Status: Active » Closed (won't fix)

I don't think this is a front page issue, at least, I can't imagine why a function wouldn't be available just for the front page.

I think you're using the wrong function.

try this instead:

$name = 'Upcoming Events';// the name of your view
print views_embed_view($name, $display_id = 'default'); 
$name = The name of the view to embed.
$display_id = The display id to embed. If unsure, use 'default', as it will always be valid. But things like 'page' or 'block' should work here.

http://views-help.doc.logrus.com/help/views/embed

marking this as won't fix.

okmi’s picture

Assigned: Phillip Mc » Unassigned
Status: Closed (won't fix) » Active

using that function worked - thank you very much for the help. someone mentioned to me that the weight of Front Page vs. that of Views2 could have been an issue. regardless, that snippet worked just fine.

Dublin Drupaller’s picture

Status: Active » Closed (fixed)