/ Published in: PHP

This code snippet make use of the API to accomplish a block with links to related content.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php $host_node = node_load($nid); $grouped = relatedcontent_variable_output_grouped($host_node->type); if($groups = relatedcontent($host_node, $grouped)) { foreach($groups as $group => $nodes) { if ($nodes) { foreach($nodes as $node) { $links[] = l($node->title, "node/$node->nid"); } $title = relatedcontent_group_title($group, $grouped, $host_node->type); print theme('item_list', $links, $title); } } } } ?>
URL: http://drupal.org/node/218844
Comments
