Some Drupal Rules

As i am working in SRIJAN technologies from past 11 months, which is a drupal development company. I learned some rules regarding drupal in this span of time, which are listed below :

  • Contributed modules should be in sites/all/modules instead of modules directory under drupal root directory.
  • Don't Ever change the core as well contributed modules, for changed functionality, make new custom modules and place all the custom modules in sites/all/custom/modules directory
  • You can make new modules by only hooks, one thing for you can make simple php functions in modules and can call that simple php function in the hook
  • For Block, you can make new block with custom modules, you just need to define the block info and block name with the hook_block_info and can display the block in any region with hook_block_view, remember you have to change the hook with your custom module name
  • If you want to show something or want to show some static and dynamic content on every page of drupal, then you have to write code in page.tpl.php, similarly if you want to show some static content on front page only then you have to use page-front.tpl.php of the present working theme, these tpl fles are called as template files
  • if you want to make a link in the drupal then you have to change the l function, you can also use drupal_goto function for the same.
    I hope this can help for new developers in drupal.