Drupal Logo

hook_menu path not working in Drupal (6,7)

Right From Drupal website : This hook enables modules to register paths in order to define how URL requests are handled. Paths may be registered for URL handling only, or they can register a link to be placed in a menu (usually the Navigation menu). A path and its associated information is commonly called a … Continue reading “hook_menu path not working in Drupal (6,7)”

[Solved] How to use hook_entity_view in drupal7 ?

I work in a team of developers and we separately develop modules in drupal. We are assigned to create entities, and there was time once I need to alter the view which was output of some other entity module. So, I am sharing here my experience how I did that. Lets say we have two … Continue reading “[Solved] How to use hook_entity_view in drupal7 ?”

Automatic ajax call using jQuery

Total used files : index.php jquery.js random.php I am using jQuery’s setInterval() method to automatically make the ajax call in every 2 seconds. index.php [sourcecode language=”php” highlight=”11,13,17″] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Refresh Page itself</title> <script type="text/javascript" src="jquery.js"></script> <script> $(document).ready(function(){ var callAjax = function(){ $.ajax({ method:’get’, url:’random.php’, success:function(data){ $("#sample").html(data); } }); … Continue reading “Automatic ajax call using jQuery”

Drupal Logo

[Solved] Add module to admin/config page in Drupal7

We are going to create a following custom block in admin/config page. To create a block in admin/config like those ‘People, Content Authoring, Media’ etc. We need to define two menu items as shown below [sourcecode language=”php” highlight=”3,13″]function products_menu() { $items = array(); $items[‘admin/config/products’] = array( ‘title’ => ‘Configure Products’, ‘description’ => ‘Allows administrators to … Continue reading “[Solved] Add module to admin/config page in Drupal7”