Closed (fixed)
Project:
ImageField
Version:
6.x-3.3
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
23 May 2010 at 20:35 UTC
Updated:
10 Jun 2010 at 17:30 UTC
Hello,
I needed to set automatic alt and title texts for my image field, depending on the node (I'm using node title and body).
To do this, I wrote my own module, which alters ImageField forms, and processes to the node token replacements after the node is save (hook_nodeapi, operation presave).
I think this module could easily be included inside ImageField module (or as a contrib module). What do you think of it ?
Please see attached file.
Regards,
David
| Comment | File | Size | Author |
|---|---|---|---|
| imagefield_token_extra.tar_.gz | 939 bytes | David Stosik |
Comments
Comment #1
idflorin commentedI tried this on one site with ImageField 6.x-3.3 and [title] as token but alt and title are still empty after save.
Comment #2
David Stosik commentedHello,
Can you check you Recent log entries ?
This module works on my side. I tried both "Enable custom alternate text" checked and unchecked (thus permitting to modify the alt text on the node form, or not), and both work...
Oh, by the way, you need to save the node containing image fields again. ;)
David
Comment #3
idflorin commentedYou are right it's working, but it's not working for my particular site setup. I use feeds with image feeds grabber, and in this particular case it's not working.
Comment #4
David Stosik commentedIf you don't use tokens, but normal text in widget's default alt and title fields, is it used ?
If no text is showing as title and alt, (a token or its value, or some text), then the problem does not come from my module, but from image feeds grabber.
By the way, I encountered some errors, and need to change the behavior of my module (using hook_nodeapi, operation presave makes token generate errors because some field are not already filled). I will post a new version as soon as it is developed.
David
Comment #5
quicksketchThis code already exists as a separate project: http://drupal.org/project/imagefield_tokens
Comment #6
David Stosik commentedOh god, why didn't I find this module before... ::)
Thanks quicksketch, I'm going to try this immediately.