Drupal Module Development: Creating a Related Nodes Block Tutorial 1 of 2
In this Drupal Video Tutorial, we take a look at custom module development. With our module, we create a block that will list other related nodes based on the taxonomy terms of the node being viewed. In this tutorial, we'll look at how to call hook_block, how to manage the $op variable, querying the database and returning a value to our block.
While this is easily done with the Views module, we'll this a step further in Tutorial #2 and ensure we get 5 random results and if 5 aren't available, we'll populate the list with additional nodes based on the content type we are viewing.
This tutorial is about 34 minutes in length and I apologize in advance for the sound quality.

Comments
hi, i'm learning from this
hi,
i'm learning from this video. In this tutorial, you are using dsm() function but it's not working.
how to i check when i create a new block module.
And also which editor you are using, because i am using Dreamviewer editor, drupal built in function is not displaying.
please help me.
thanks,
pandikamal
Hi Pandikamal, with regards
Hi Pandikamal,
with regards to the dsm() function, sounds like you don't have devel installed. dsm is a function of that module.
With regards to the editor, I am using Komodo with a drupal plug in. Just google both to get the same functionality you see in the tutorials.
Thanks for watching.
Pete
Hi Pete, thanks for reply. i
Hi Pete,
thanks for reply. i have installed devel module and working dsm() function.
regards,
pandikamal
Great Tutorial the Drupal
Great Tutorial the Drupal Module Development: Creating a Related Nodes Block Tutorial 1 of 2 I have been watching it but at 17:20 mins the image becomes unreadable, I tested it with couple of different computers, I wish it worked because it seems great. If it is not to much of a problem for you, could you fix it somehow.
Take care.
Joe
Hi Joe, thanks for the
Hi Joe,
thanks for the feedback. I remember this tutorial gave me a tonne of trouble with sound and video. I'll take a look at it when I have a minute and see how I can help out.
Thanks,
Pete
Hi I followed your Drupal
Hi I followed your Drupal Module Development: Creating a Related Nodes Block Tutorial and I believe is excellent.
Only one issue. When I activate the Module when I go to Home › Administer › Site building Blocks, I get the following warnings.
warning: Attempt to assign property of non-object in /home/devfcace/public_html/includes/common.inc on line 3489.
warning: Attempt to assign property of non-object in /home/devfcace/public_html/includes/common.inc on line 3489.
warning: Attempt to assign property of non-object in /home/devfcace/public_html/includes/common.inc on line 3489.
warning: Attempt to assign property of non-object in /home/devfcace/public_html/includes/common.inc on line 3489.
warning: Attempt to assign property of non-object in /home/devfcace/public_html/includes/common.inc on line 3489.
warning: Attempt to assign property of non-object in /home/devfcace/public_html/includes/common.inc on line 3489.
warning: Attempt to assign property of non-object in /home/devfcace/public_html/includes/common.inc on line 3489.
warning: Attempt to assign property of non-object in /home/devfcace/public_html/includes/common.inc on line 3489.
warning: Attempt to assign property of non-object in /home/devfcace/public_html/includes/common.inc on line 3489.
warning: Attempt to assign property of non-object in /home/devfcace/public_html/includes/common.inc on line 3489.
warning: Attempt to assign property of non-object in /home/devfcace/public_html/includes/common.inc on line 3489.
user warning: Duplicate entry '0' for key 2 query: INSERT INTO blocks () VALUES () in /home/devfcace/public_html/includes/common.inc on line 3538.
Thanks,
Fred.
Hey Fred, I sent you an
Hey Fred,
I sent you an email - send me your .module file and I'll try and help out.
Pete
Hi, Its a great tutorial. But
Hi,
Its a great tutorial. But i am not able to download source file. Can you please provide a working link to download module.
Thanks
This is a great tutorial,
This is a great tutorial, unfortunately, the quality goes really bad around 17 min and on.
I wish that would be fixed.
Sia.
I mean the video quality, the
I mean the video quality, the sound is actually good.
Thank's for the video, can
Thank's for the video, can you provide us a link of the code?
Thank's
Post new comment