Joshua Williams

Joshua Williams
Job Title: 
Engineer Apprentice

I am a programmer, web developer, webmaster and graphic-designer-in-training. I live in Estes Park, Colorado with my family (parents and eight younger siblings). After connecting through their e-learning site, HomeGrownProgrammers.com, I have worked with Automation Excellence for over a year and also have some freelance programming experience prior to that.

My uncle introduced me to programming about ten years ago and since then I cannot remember a time when I did not have at least one project in progress just for my own enjoyment. I love programming and have worked with Java, PHP, Dark Basic, Ruby, and C++ while dabbling in a few others.

Currently I do much of the online teaching on the Home Grown Programmers site and I love the thrill of introducing the next generation to the intricacies of information technology.

My Blog

Wed, 08/18/2010 - 12:00

Blocks created by a view in Drupal do not have access to the page URL and thus arguments won't work normally. However, by using some custom PHP code in the argument default setting, we can pass information from the URL to the block as if it were a page.

The best tutorial I was able to find on this is here: Drupal View Block With Arguments

The PHP code I used to get a user's blog to show under his team profile page on this site is below. Used as default argument code for "User: Name."

$path = drupal_get_path_alias($_GET['q']); //get alias of URL
$path = explode('/', $path); //break path into an array
if ($path[0] == 'team' && $path[1] != '') {
  return $path[1];
}