Create a help page for embedding a view in the views advanced help

fletchgqc - May 2, 2008 - 08:55
Project:Views
Version:6.x-2.0-beta2
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:active
Description

How do I render a view in views 2.x? Can you tell us some of the exposed methods or how we can figure them out (sorry I'm not too experienced in this stuff).

In views 1.x I am able to do this:

<?php
$view
= views_get_view('my_view');   
$rendered = views_build_view('embed', $view, NULL, FALSE, NULL);
print
$rendered;
?>

But views_build_view is no longer a function... how do I do this?

#1

merlinofchaos - May 2, 2008 - 15:35
Status:active» fixed

See http://views.doc.logrus.comf

#2

merlinofchaos - May 2, 2008 - 15:36

Err, http://views.doc.logrus.com -- dunno where that f came from. :P

#3

moshe weitzman - May 5, 2008 - 12:30
Title:Exposed methods in views 2.x» Embedding a View in views 2.x
Status:fixed» active

Also see http://groups.drupal.org/node/10129.

@merlin - consider adding an Embed link like you did for 'Theme: information'. It would have some example embed code.

#4

merlinofchaos - May 5, 2008 - 18:34

I'm not sure I want to put embed code as part of the view information stuff; but more documentation on the topic could be valuable, I suppose.

#5

merlinofchaos - May 7, 2008 - 23:14

Oh, there's also the very helpful function views_embed_view() -- meant ot make it very easy to embed a view using the preview() functionality.

#6

merlinofchaos - May 9, 2008 - 00:45
Title:Embedding a View in views 2.x» Create a help page for embedding a view in the views advanced help
Category:support request» task

Changing title to reflect what needs to happen here.

#7

brad bulger - August 4, 2009 - 00:42

It would be very helpful to have some documentation somewhere about how to convert calls to views_build_view() to views 2.x. Specifically, how to achieve the same effects as using the old $use_pager, $limit, $page, $offset, $filters arguments. If this is already written, then maybe including a link in the documentation for views_embed_view()? Or some kind of "Upgrading embedded view calls" or suchlike? I cannot find anything like this. Thanks.

 
 

Drupal is a registered trademark of Dries Buytaert.