Hey everyone,

In Drupal 5, I used to use the great module Insert View quite a bit to put the contents of a view into the a node. Insert view is almost ready for Drupal 6, but I'm curious:

How would I do this on my own using PHP?

The Insert View docs mention that you can "invoke a view using PHP" but I'm having trouble finding out directions on how to do this as I search around.

Say, for example, I've got a View that creates the following query:

SELECT node.title AS node_title,
   COUNT(node.nid) AS num_records
 FROM node node 
 WHERE node.type in ('news')
 GROUP BY node_title
  ORDER BY node_title DESC

How would I wrap that up so that I could place a snippet of PHP within a node to invoke the view? (Note - I've got the PHP module activated and appropriate permissions set).

Thanks!

Doug

Comments

knalstaaf’s picture

bumpert