[development] Listing Nodes in a Node View
Ron Parker
sysop at scbbs.com
Tue Dec 18 20:43:37 UTC 2007
I've almost got this working. Utilizing code contributed in the module
development forum, I have verified that my $output is correct.
I have a screen shot here: http://www.scbbs.com/node/307
In agenda_nodeapi, this one line doesn't appear to work:
$node->content['agenda'] = array(
'#value' => $output,
'#weight' => 15,
);
I'm defining the field "agenda" here. This is not defined or set up
anywhere but here. Is this how it's supposed to work? If so, what
could I possibly be doing wrong here?
The entire code:
function agenda_nodeapi($node, $op, $arg = 0) {
global $form_values;
switch ($op) {
case 'view':
// If the user has the view agenda perm and this node is agenda
enabled
// display the agenda list.
if (user_access('view agenda') &&
agenda_type_is_enabled($node->type)) {
$output = agenda_list($node->nid); // This gets a themed table.
drupal_set_message("agenda_nodeapi: output is $output"); //
I'm seeing this, so correct output is calculated
// Store the data directly into the content array, for default
display.
$node->content['agenda'] = array(
'#value' => $output,
'#weight' => 15,
);
}
break;
Thanks!
-ron
--
Ron Parker
Software Creations http://www.scbbs.com
Self-Administration Web Site http://saw.scbbs.com
SDSS Subscription Mgmt Service http://sdss.scbbs.com
Central Ave Dance Ensemble http://www.centralavedance.com
R & B Salsa http://www.randbsalsa.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20071218/8d6399a9/attachment.htm
More information about the development
mailing list