Language
  • English
  • Français
Drupal custom theming or module development price estimate calculator

Intermediate : All

drupal tutorials Welcome to my Drupal Tutorial listing. I have tried to make the tutorials as easy to find as possible by categorizing them by skill level and by the three major areas of Drupal development: Drupal Administration, Drupal Theming, and Drupal Module Development. If you are not able to find the information you are looking for feel free to post a Drupal question and I will do my best to answer it. (Note: you must login or register with this site in order to post content.)

CCK create automatically updating year select field

When you want to create a list of years as a select field in CCK ranging from some set date in the past to the current date you have a couple of options. The first option would be to go through and manually enter every year from that date to present. This may be ok if you only are working with a date range of 3 or 4 years, but what if you want to list the years since the 1800s. Obviously that list would be painful to make, and what's worse you would have to make sure the site was updated every year by someone competent enough not to destroy the information.

How to remove spaces when using term names or node titles for views arguments (SEO Optimization)

There seems to be some debate as to whether there is an actual SEO penalty to using spaces or the encoded %20 in urls. I've spent some time researching the matter and I wasn't able to come away with any conclusive evidence one way or the other. However, when a client wants a site with no spaces or %20 in the urls that is in itself a deciding factor.

Apparently my client and I aren't the only ones that ran into this problem, and perhaps I wasn't the only one to come up with this solution, but I didn't find it posted anywhere else on the internet, so I am going to post it here.

How to programmatically insert a view into a tpl or content in Drupal 6

In Drupal 6 views has been completely rewritten from the ground up, and as such we have to adjust the little code snippets that we developers have collected over the years to compensate.

The old way ( Drupal 5 views 1 ) of inserting a view into a tpl or into a php enabled content area was as follows:

<?php
$view_name = 'text_listing'; //name of view
$view_args = array($oldstring) ;
$view = views_get_view($view_name);
print views_build_view('embed', $view, $view_args, $view->use_pager, $view->nodes_per_page);
?>

This has now changed to the following:

<?php
  $view_args = array();
  $display_id = 'page_1';
  $view = views_get_view('logo_slideshow');
       if (!empty($view)) {
        print $view->execute_display($display_id , $view_args);
  }
?>

How to use Taxonomy to classify your pages in Drupal

Taxonomy is not a common word to hear in the English language, so chances are if you haven’t dedicated your life to studying the mating habits of African dung beetles or tinkering with Drupal then you may not have even heard the word before. Taxonomy refers to a system of classification used to group similar items. In Drupal Taxonomy is used to group your pages by the subject matter or by other criteria so that they can later be sorted into page listings (using the Views module) or manipulated in some other fashion.

How to insert a block into a tpl or into content programmatically with Drupal

There are several ways to insert blocks onto a page with Drupal. You can use panels, you can add a region to the theme, or you can call the blocks programmatically with php. Though it might not seem evident at first there are some situations where it really is much easier, or better just to call a block with php rather than using the other options. One good example is where you want to add a particular block to a page that shows up in an odd location (such as the top right hand corner of the page) where panels can’t get to.

Ask a question related to Drupal development or administration