theming

Get the most out of Drupal webform module

Today I was looking for a way to customise the confirmation e-mail sent by the webform module. It appears that it's possible to customise this mail per form. By looking a bit further I discovered a file I had overlooked all of the time. This little file is called THEMING.txt and it delivers what is promised: it shows you how to customise all things Webform.

What will you discover there?

  • Theme submission emails
  • Theme the confirmation page
  • Theme display of an entire webform

Great! This teaches you how to customise the 3 parts in a webform subimission process: form display, confirmation screen and confirmation e-mail.

Go ahead and read it here: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/webform/THE...

My new portfolio website is launched

I've just launched my new portfolio website.

Go visit it at davyvandenbremt.be.

I need to take a break now.

Some really interesting posts are coming up!

Screenshot davyvandenbremt.beScreenshot davyvandenbremt.be

Drupal Snippets : Share you code

A 'snippet' is "a programming term for a small region of re-usable source code or text", says Wikipedia. Of course there are a lot of snippets available for such a popular environment as Drupal.

In the Drupal handbook, the official documentation for Drupal, you can find two sections with snippets. One is for general PHP, SQL, view, block, ... snippets. The other is for theme snippets.

There are also two unofficial resources available, DrupalBin, a pastebin website for Drupal, and Drupal Snippets. The second one has few snippets available right now though. So the most dynamic resource to keep an eye on is DrupalBin.

There's probably a few more. I invite you to submit those in the comments.

Portable sites with base href / $base_url in drupal

By declaring a base href you can tell the browser that all relative links contained within the document start from that specified base location. This allows you to view how the related document will look and behave when placed on the server without actually having to do so. It also allows you to put your Drupal site in a subdirectory of your website.

Suppose you have a domain, www.yourdomain.com. You would like to put Drupal in a subdirectory called 'drupal-site'. Your homepage then would be http://www.yourdomain.com/drupal-site.

Now you have an about page, http://www.yourdomain.com/drupal-site/about/ and all your image are under http://www.yourdomain.com/drupal-site/images/. So if you would like to refer to an image in your about page you would have something like:

<img src="/images/myimage.jpg" />

The problem is the browser will interprete this as http://www.yourdomain.com/images/myimage.jpg.

In this case you would state the following tag in your html header:

<base href="http://www.yourdomain.com/drupal-site/" />

Drupal has its own way of working with this. In settings.php you have to put the global variable:

<?php
$base_url = 'http://www.yourdomain.com/drupal-site/';
?>

And in your page.tpl.php you print it:

<?php global $base_url; ?>
<base href="<?php  print $base_url ?>" />

Syndicate content