Drupal 7 - Get raw values from path

$path = drupal_get_path_alias($_GET['q']); $path = explode('/', $path); return $path[0];
Displaying dynamic blocks through views and the contextual filter can sometimes be tricky as the Drupal URL output isn't always consistent . This snippet provides a quick, direct way of grabbing arguments directly from the raw url.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.