Display (x) full flexinodes in a page
PLEASE NOTE! The following snippets are user submitted. It's impossible to test them all so please use at your own risk! For users who have setup Drupal using an alternate database to the default (MYSQL), please note that the snippets may contain some database queries specific to MYSQL.
<?php
/**
* Displays (x) full flexinodes in a page
*
* To change which flexinode type is being referenced, change
* the $flexi_id value
* To change the length of the list, change
* the $list_no value
*
* This snippet works with Drupal 4.6.x
*
*/
$flexi_id = "flexinode-2";
$list_no =10;
$sql = "SELECT node.type, node.nid FROM node WHERE node.type = '$flexi_id' LIMIT $list_no";
$result = db_query($sql);
while ($node = db_fetch_object($result)) {
$output .= node_view(node_load(array('nid' => $node->nid)), 1);
}
print "<div id=\"recommended_links\">";
print $output;
print "</div>";
?>
How do you extract nodes
How do you extract nodes from multiple flexinodes?
I havn't tested it but
I havn't tested it but probably something like:
<?php/**
* Displays (x) full flexinodes in a page
*
* To change which flexinode type is being referenced, change
* the $flexi_id value
* To change the length of the list, change
* the $list_no value
*
* This snippet works with Drupal 4.6.x
*
*/
$flexi_id = "flexinode-2";
$flexi_id2 = "flexinode-6";
$list_no =10;
$sql = "SELECT node.title, node.type, node.nid FROM node WHERE node.type = '$flexi_id' OR node.type = '$flexi_id2' LIMIT $list_no";
$result = db_query($sql);
while ($node = db_fetch_object($result)) {
$output .= node_view(node_load(array('nid' => $node->nid)), 1);}
print "<div id=\"recommended_links\">";
print $output;
print "</div>";
?>
This led me to a solution to another very similar problem
It's based on this code, but modified for my own purposes. Not sure who originally wrote the code, but figured I'd drop some respect to ya :)
My version is over here
http://drupal.org/node/72439#comment-135228