I've enabled the Custom Formatters module but I feel a little helpless when having a look at the given examples in the module.

The purpose is to expose the URL, ALT and TITLE attribute of an image in a View ("description" has been removed in Views 3, eventhough I was frequently making use of that field). This was supported in Views 2 ("Format: [imagecache name] URL", "Image field name - data"), now these options are stripped out in Views 3.

Custom Formatters was mentionned as the right solution for this matter - and I do believe this is the best practice indeed. But I can't seem to apply the examples given in the module itself on the described purposes.

Is it possible to give a brief sample code for the purpose above that should get me on the road again? I'd use it for building a Views Galleriffic gallery, which displays all the images from one single node (worked out succesfully in D6).

Comments

Jerome F’s picture

Jerome F’s picture

Here are the variables available for an image field (attached screenshot)
I used devel module and the process descibed in admin/help/custom_formatters to get them then I created a view and used this custom formatter to display my image field.

so you probably would use :

$item['title']

and

$item['alt']

in your custom formatter

knalstaaf’s picture

Thank you very much!

Jerome F’s picture

is this issue fixed ? I would be greatly appreciated if you can share your formatter once done and mark this issue as fixed.

TimelessDomain’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
deciphered’s picture

Status: Active » Fixed

Marking this as fixed. Please re-open if otherwise.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

summit’s picture

Hi,
I do not understand: http://drupal.org/node/1094312#comment-4485176
The array says #items. Shouldn't that be used than?
I tried with #items, but no go until now with link field, see: http://drupal.org/node/1379704#comment-5400646

EDIT: Got something working, see: http://drupal.org/node/1397700#comment-5443478
Greetings, Martijn