theme

How to change the HTML markup in a field with a theme function in Drupal

Ever wanted to change the Drupal 7 markup? Get rid of all those pesky divs? If so, this is article for you. I will give you a simple example how to do this not by changing the site theme (template.php) but by using a theme function.

Yes, you have make a module, and yes, I will show you have to make it. You will also find, attached to this article, the complete code wrapped up in a zip-file. Using theme functions is not that hard so relative new Drupal users and themers should be able to follow, though, a basic PHP knowledge might come in handy.

How to add image caption to your imagefield and imagecache

Changes:

09.11.2011 - Fixed error in template.php

Overview

This how to will to point you the right direction, hell even providing you with an solution to how to add caption to your image fields. No magic, no extra modules. We simply take usage of the title field that is a part of imagefield.

Subscribe to RSS - theme