Drupal 7 Get Default Files Directory Path

While working on Drupal coding, sometimes you may want to get the default files directory path. Here it is said as 'default' intentionally, as you can configure a Drupal installation to have default directory as public or private. For most of the sites it will public files directory.

Moving Preprocess Functions to Separate Files in Drupal 6 & 7

When you implement hook_theme() in Drupal, there is provision to specify the file which should be loaded for the theme functions and preprocess functions to be found. So, we can simplify module file by moving out theme function and preprocess function of our theme entries to separate file. This also has added benefit of reducing module loading. On each bootstrapping Drupal will load every .module file those are of enabled modules. So we should consider moving out code from .module file and also giving modular structure.

subscribe via RSS