Drupal Module Path Check

Ever upload new modules to Drupal but you don’t see the new module files taking effect? Chances are that you have more than one of the same module. You can check to see what the path is for a specific module using the pattern below and inserting it into a page.tpl.php or node.tpl.php file:

<?php print drupal_get_path(‘module’, ‘views’); ?>

In this case I wanted to find the path to the active views module as I had uploaded a newer version but Drupal was still detecting (and using) an out of date version. This can happen when you have the same module uploaded twice because you have different file names or when the module is within child directories of the /sites/all/modules folder. The best practice for placing modules is to have contrib & custom folders within the /sites/all/modules folder and put the modules from the open source community into the contrib folder and to put your own custom modules into the custom folder. The “core” modules belong in the modules folder located at the root of the Drupal install. DO NOT EVER PUT CORE MODULES into the sites/all/modules directory!

Leave a Reply