[support] Views 2 -- Embedding outpuut in a page

Hugo Mills hugo-dru at carfax.org.uk
Thu Apr 24 14:27:22 UTC 2008


   I'm a rank newcomer to Drupal, so please excuse me if I'm being
stupid...

   I've created a view in my site (Drupal 6.2, Views 2.0-alpha4 at the
moment), and I can successfully get the view to show a preview of the
content I was expecting on the view definition page. However, I can't
seem to embed that view into a page. I've tried any number of
variations on the following code in the page (filched from [1]), but I
simply get no output at all where the code is.

<?php
$view = views_get_view('releases');
$view->init();
$view->set_display();
$view->set_arguments(array('5'));
$view->is_cacheable = FALSE;
$view->render();
?>

   I've tried $view->execute_display() as the last line as well as
$view->render(), and tried printing the result of each of those, too,
all to no avail.

   I've tried looking at the doxygen docs, too, but there's not much
in there to give me a high-level view of how things fit together.

   Yours, confused,
   Hugo.

[1] http://groups.drupal.org/node/10129

-- 
=== Hugo Mills: hugo at ... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
   --- We are all lying in the gutter,  but some of us are looking ---   
                              at the stars.                              
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.drupal.org/pipermail/support/attachments/20080424/24385302/attachment.pgp 


More information about the support mailing list