[development] Listing Nodes on a Node View
Ron Parker
sysop at scbbs.com
Tue Dec 18 17:53:25 UTC 2007
I've created an agenda.module which associates agenda nodes with event
nodes. I wish to list all agenda nodes associated with a particular
event when I view the event. I've come up with code in hook_nodeapi that
I *thought* would do this, but it isn't. Can anyone help? Thanks.
<?php
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.
// Save output into a node property for retrieval from the
theme layer.
$node->agenda_view = $output;
// Store the data directly into the content array, for default
display.
$node->content['agenda'] = array(
'#value' => $output,
'#weight' => 15,
);
}
break;
?>
I'm not sure about my use of $node->agenda_view and
$node->content['agenda'] as I basically copied that code from another
module (signup) which lists items in the event node view in the format I
wish.
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/0328abc3/attachment.htm
More information about the development
mailing list