This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

help with taxonomy_render_nodes

Hi all,

I've been stucked with this for two weeks now.

This block of code does exactly what I want

<?php
  $random_nid = 42;
  $tids = array_keys(taxonomy_node_get_terms($random_nid));
  $result = taxonomy_select_nodes($tids);
  $output .= '<p>';
  $output .= taxonomy_render_nodes($result);
  $output .= '</p>';
  return $output;
?>

but when I use it in my module below, the taxonomy_render_nodes function fails with "memory exausted".
I've tried to increase the memory, but it didn't help.

Any Ideas ?

function committee_view(&$node, $teaser = FALSE, $page = FALSE) {
  $content = theme('committee',$node);
  $node->body = $content;
  return $node; 
}

function theme_committee($node) {
  $output ='';

  $header = array(t("Chair"),t("Secretary"),t('Frequency'),t('Rep/Delegate'));

  $rep = ''; 
  $rows[0] = array($node->chair,$node->secretary,$node->frequency,$rep);

  $output .= theme('table', $header, $rows);

  $output .= '<div class="content">';
  $output .= l(t("Go to the Committee Homepage for more Information"), "$node->homepage");
  $output .= "<br/><br/>";
  $output .= t("$node->body\n");
  $output .= '</div>';

  $tids = array_keys(taxonomy_node_get_terms($node->nid));
  $result = taxonomy_select_nodes($tids);
  $output .= '<p>';
  $output .= taxonomy_render_nodes($result);
  $output .= '</p>';

  return $output;
}

Older module compatability with newer drupal versions?

I'm aware some of them wont work but off hand anyone know which ones do work out of the modules that haven't be updated specifically to the new 4.6.1? I'm thinking of using the cafepress one but unsure if it will bork if I attempt to use it.

Smarty Engine usage(not related to the Smarty Module)

Hi,
I posted a question about the use of Smarty at http://drupal.org/node/24442 and found my own answer.

My other question is:
Is it desirable to use all those functions like theme('table', $header__row, $rows) , form_submit to create the UI components?

what do I lose if I just html-code tables, forms etc in my smarty template file and fill in the data?

Sort nodes by node ID

I am using the new module Aggregator2, which creates permanent nodes from RSS feed items. Drupal by default sorts these based on creation date -- a variable the module generates by sniffing the feed's data.

I like this creative use of dating. But I want the nodes instead to be sorted by the order they were generated by Drupal. Newer ones would appear at the top and push older ones south.

I have searched but not found -- probably due to lack of demand -- a way to sort nodes by node id. Ideas?

New to Drupal - Trying to create a simple module (from an existing block)

I'd like to write a simple module that displays a list of files available for download.
I've followed the sample module guide/tutorial, and I've got the basics of this done (very quickly, yay!) - as a block. What I don't understand yet, is how this block could be transformed to show as a page as well.

A little image insight?

I've been using Drupal for a while and love it, but I am confused regarding image galleries / albums. I'm making a MySpace.com type site where I want users to post image galleries / photo albums like the book module.

I've used image.module, album.module, even tried gallery2 and simplealbum.module (for 4.5), but they don't really do what I want or work very well. I want to help developing this functionality, but want to know:

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions