Web Development Tips

How to display caption for galleria image gllery with image filefield – Drupal

Posted by: slvramesh on: May 10, 2010

Problem definition:

Drupal is the best CMS with building media related sites. Galleria is the best module for image gallery in drupal, the galleria module did not support caption when you use image filefield because the gallery module get caption for field description. When you use filefield it is support title and alt input field.

So here is the solution for getting caption for image in title tag.

1) In the content type manage fields enable alt and title tags.
2) Add the following coding in your galleria.module file function theme_galleria_formatter_imagefield_galleria end the “alt” text.
‘title’ => $element[$key]['#item']['data']['title']
3) Replace the coding in the function “template_preprocess_galleria”
$caption = ($image->title != $image->filename) ? $image->description : ”;
to
$caption = ($image->title != $image->filename) ? $image->title : ”;

Now view your galleria image gallery, caption will dispaly.

Cheers!

Advertisement

5 Responses to "How to display caption for galleria image gllery with image filefield – Drupal"

Thanks a lot for the Drupal tutorial, you prefer Drupal in comparison to Joomla and WordPress?

Yes, Drupal is the best CMS compare to joomla and wordpress.

nice tutorial…. thanx for share

What versions? Not working with Drupal 6.2 and Galleria 1.x-dev.
Has something changed?

$caption = ($image->title != $image->filename) ? $image->description : ”;
is not present in Galleria 1.0

Nice tutorial. Do you know how to implement Galleria on Drupal 7?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.