I need to add a link as a rendered array to node views. I have accomplished this from a page. The link calls an AJAX function and refreshes a custom module block. Now I need to put a series of links in node views. These will add records to module generated database tables based on the contents of $node, specifically $nid, then refresh a block that will reflect the new record. I am learning much about Drupal 7. I am an experienced developer, but Drupal is so complex, that I seem to be struggling with every step. It took me an embarrassingly long time to figure out how to refresh a block from a content page link. Can someone give me the basics (or specifics) I need to accomplish this next step? Note: I have been posting similar questions on the support list, but am getting almost no responses, so I¹m trying the development list. I thought the development list was probably for Drupal contributors, but maybe not, or maybe you guys can help me anyway. Thanks in advance, -- Alex Adams hawkVision building highly agile worlds of knowledge A2 Technology Partners, Inc. 831-724-1397 alex@a2technology.com www.a2technology.com
I need to add a link as a rendered array to node views. I have accomplished this from a page. The link calls an AJAX function and refreshes a custom module block. Now I need to put a series of links in node views. These will add records to module generated database tables based on the contents of $node, specifically $nid, then refresh a block that will reflect the new record.
Be careful with your language -- when I read "views" in the context of Drupal, it usually means the Views module. What do you mean by "node views?"
Carl, I mean content items that are rendered in a view mode. I am imagining that hook_node_view_alter() would be used to add links to the node before it¹s rendered from the render array. What I don¹t know how to do is add something to this array. Am I on the right track? -- Alex Adams hawkVision building highly agile worlds of knowledge A2 Technology Partners, Inc. 831-724-1397 alex@a2technology.com www.a2technology.com From: Carl Wiedemann <carl.wiedemann@gmail.com> Reply-To: <development@drupal.org> Date: Thu, 7 Jul 2011 11:29:35 -0600 To: <development@drupal.org> Subject: Re: [development] Links in node view
I need to add a link as a rendered array to node views. I have accomplished this from a page. The link calls an AJAX function and refreshes a custom module block. Now I need to put a series of links in node views. These will add records to module generated database tables based on the contents of $node, specifically $nid, then refresh a block that will reflect the new record.
Be careful with your language -- when I read "views" in the context of Drupal, it usually means the Views module. What do you mean by "node views?"
On Thu, Jul 7, 2011 at 11:08 AM, Alex Adams <alex@a2technology.com> wrote:
I need to add a link as a rendered array to node views. I have accomplished this from a page. The link calls an AJAX function and refreshes a custom module block. Now I need to put a series of links in node views. These will add records to module generated database tables based on the contents of $node, specifically $nid, then refresh a block that will reflect the new record.
I am learning much about Drupal 7. I am an experienced developer, but Drupal is so complex, that I seem to be struggling with every step. It took me an embarrassingly long time to figure out how to refresh a block from a content page link.
Can someone give me the basics (or specifics) I need to accomplish this next step?
If you want to add content to the node display, I would look at the hook 'hook_node_view' (http://api.drupal.org/api/drupal/modules--node--node.api.php/function/hook_n...) The whole purpose of this hook is to add content to the display of a node. -- John Fiala www.jcfiala.net
John, I am imagining that I want to add my links to the render array using hook_node_view_alter() right before the rendering is done. What I don't know how to do is add something to the render array. Does this sound right? -- Alex Adams hawkVision building highly agile worlds of knowledge A2 Technology Partners, Inc. 831-724-1397 alex@a2technology.com www.a2technology.com
From: John Fiala <jcfiala@gmail.com> Reply-To: <development@drupal.org> Date: Thu, 7 Jul 2011 11:30:16 -0600 To: <development@drupal.org> Subject: Re: [development] Links in node view
On Thu, Jul 7, 2011 at 11:08 AM, Alex Adams <alex@a2technology.com> wrote:
I need to add a link as a rendered array to node views. I have accomplished this from a page. The link calls an AJAX function and refreshes a custom module block. Now I need to put a series of links in node views. These will add records to module generated database tables based on the contents of $node, specifically $nid, then refresh a block that will reflect the new record.
I am learning much about Drupal 7. I am an experienced developer, but Drupal is so complex, that I seem to be struggling with every step. It took me an embarrassingly long time to figure out how to refresh a block from a content page link.
Can someone give me the basics (or specifics) I need to accomplish this next step?
If you want to add content to the node display, I would look at the hook 'hook_node_view' (http://api.drupal.org/api/drupal/modules--node--node.api.php/function/hook_n... de_view/7) The whole purpose of this hook is to add content to the display of a node.
-- John Fiala www.jcfiala.net
participants (3)
-
Alex Adams -
Carl Wiedemann -
John Fiala