Closed (works as designed)
Project:
ImageField Tokens
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
9 Apr 2009 at 09:30 UTC
Updated:
20 Nov 2012 at 01:17 UTC
Hi there,
I hope I'm not duplicating this issue #408088: Tokens not replaced in node output but you mentioned the need to create a new issue. I have changed the title and alt on my images using the new tokens but unless I open each node and save it again the new alt and titles aren't being adopted.
I've tried publishing all the nodes through the content section but that doesn't work. Is there a way of flushing (is that the right word?) all the alt and title tags?
Thanks
Thomas
Comments
Comment #1
decipheredHi Thomas,
I can certainly see the benefits of such a feature, and as it would be built on top of FileField Paths 'Retroactive changes' functionality it would actually be quite simple to implement.
However, there are a few issues that could be possible deal breakers:
- As with 'Retroactive changes', the module has to load in every single node of the content-type and reprocess them, which could potentially overload your server depending on the number of nodes.
- As the unprocessed version of the ALT and Title fields are not stored anywhere it would have to replace all ALT and Title fields with the new default which means any custom entries would be over-written.
I will keep the idea in mind and if I can come up with a solution I will look at implementing it.
Cheers,
Deciphered.
Comment #2
artscoop commentedHi,
as you say, it would be a nice feature to have in Imagefield tokens.
I have some strange issue with all my nodes not having any Title or Alt Text.
And I've found out why : it's because I use Imagefield Import to create nodes.
So indeed, it would be great to overwrite these values.
Cheers
Comment #3
decipheredHi artscoop,
I have just submitted a patch for ImageField Import to retain the ALT and Title defaults during import which allows it to work correctly with ImageField Tokens.
#435060: ImageField Data Defaults
As for this function, your interest is duly noted, but I still have to work out exactly how I will approach things.
Cheers,
Deciphered.
Comment #4
decipheredInherited functionality from the "Active updating" functionality just added to FileField Paths.
Cheers,
Deciphered.
Comment #6
sammyman commentedHi there. I am in the same situation. I have about 2000 tokens that I would like to "flush" so the new tokens are visible. Is there anyway to do this with content management filter or anything like that where I could automatically "edit" and save each node?
Comment #7
finex commentedI've the same problem... with the only difference that I've about 5000 nodes to update... I've solved with an hand made script, but it could be useful to have an option to update alt and title tags on existing nodes.
Comment #8
finex commentedThis is the script I've used to update my DB in order to update retroactively all titles and alts of the existing image field. In my specific case I've set the node title for both. If yuou have more complex tokens, you've to change a bit the script.
Be careful, don't execute the script as is: edit it to match your fields. I suggest to add this script (or a more general one) on the docs, or adding a link to this thread on the main page of the module.
Bye
Comment #9
maartendeblock commentedThe last part contains a few errors and will not work.
If you serialize an array { and } will be used. These are also used to replace table names in case a db_prefix is used. The correct code should be something like this:
Comment #10
cancerian7 commentedThanks maartendeblock. Your code worked.
Comment #11
jordanmagnuson commentedThis is great. Would it be possible to add "Retroactive updating" also, now that that functionality has been added to FileField Paths (which works great, I might add)? I have over 2000 nodes with images that have no alt or title tags, and I need to figure out some way to retroactively update them all... it seems like FileField Paths' method might easily be adopted for use with ImageField Tokens?
Comment #12
heyyo commentedIf there is already title or alt defined it will be replaced by the node title, may be better to keep the existing alt title which should be more precise.
Comment #13
cyberwolf commentedSubscribing.
Comment #14
agileware commentedAlso, with those scripts note that depending on your field the table might be
content_field_FIELDNAME
or
content_type_CONTENTTYPE
If it is a multiple value field or the field is used on multiple content types it will be the former, otherwise the latter.
Comment #15
agileware commentedAlso, if you are using a multiple value field you will also need to use the delta column in your sql queries to make sure everything is unique.
Comment #16
rickh commentedHey guys, i'm pretty new to Drupal but I have a resonably large site that desperately needs this functionality. I'm not exactly sure how to implement the code above. Is it a patch/custom module or does it have to do with the databse itself. Know absolutley nothing about databses so any help would be greatly appreciated
Comment #17
13rac1 commentedRetroactively resaving nodes can be done with: http://drupal.org/project/views_bulk_operations
A good description of resaving all nodes programmatically in D5 and D6 can be found here: http://www.templatezine.com/2010/06/drupal-re-save-all-site-nodes/
Comment #17.0
13rac1 commented...minor edit: converted the link pointing to the issue to the [#...] format.