Step Create the module File

This is a step that is easier said than done. To begin, you first decide where your module will start. Drupal modules do not start from line 1, but rather, from any one of Drupal's hooks. In the second exercise, hook_node_view was the starting point for the module, but only when Drupal is displaying a node. If the module also implemented hook_comment_view, it would contain two starting points: one when a node is viewed and the other when a comment is viewed.

Drupal is built using the PHP scripting language; thus, all Drupal modules are built using PHP. In order to effectively write Drupal modules, you should invest some time in learning the PHP scripting language. However, understand that PHP is merely the foundation for Drupal. Drupal adds a new layer on top of PHP by providing new functions and functionality. In fact, Drupal adds over thousands of new functions and over 100 hooks to deal with website-specific items such as RSS feeds, comments, user accounts, website content, and so on. This reason alone is why Drupal is considered a content management framework instead of a system.

Article Marketing Knockdown

Article Marketing Knockdown

The lifeblood of any online business is in being able to generate highly targeted, consistent traffic to your websites, landing pages and squeeze pages.

Get My Free Ebook

Post a comment