Drupal Snippets

Drupal Snippets

 Drupal 7.x Snippets 1 2 3 4 5 6 // Get drupal's root url $GLOBALS['base_url'] => http://example.com/drupal base_path() => /drupal/ request_uri() => /drupal/documentation?page=1 request_path() =>...
Debugging PHP Within Drupal

Debugging PHP Within Drupal

Debugging php within drupal can be a tricky process for a new developer. I use the print_r() and var_export() PHP functions. Both of these PHP functions break down the PHP variables, array and objects into a readable structure. var_export() can be used with...
Drupal, Avoiding Lost URLs After Login

Drupal, Avoiding Lost URLs After Login

Drupal has a nasty habit of forgetting your requested URL after login. To avoid the annoying loss of your requested URLs, the URLs should be constructed like this “?q=user/login&destination=theurl”, adding the destination variable to the end of the...
Removing Drupal’s HTML Span Wrapping

Removing Drupal’s HTML Span Wrapping

This is how to remove the annoying span tags form those Drupal HTML field string variables retrieved through Views and other modules. If you work with Drupal at the PHP level.  You probably have noticed that some of the variables you wish to print/use are nested...