Closed (won't fix)
Project:
ImageField
Version:
5.x-2.0-rc6
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
13 Feb 2008 at 07:35 UTC
Updated:
10 Feb 2009 at 14:00 UTC
Hi,
I tested imagefield 2 with the new token integration (wonderfull idea to avoid the creation of 99999 image field type just to separate path..), but there is one thing that annoy me.
I didn't see node token for example, the node type, to separate images of different node types into different destination folder, I saw some token for users, but not nodes.
It is a bug or a missing feature actually and it will be implemented ?
thanks
zmove
Comments
Comment #1
alippai commentedPlease add taxonomy tokens too :)
Comment #2
zmove commentedHmmm, any answer would be appreciated, just to know if I can use imagefield for my needs, or if I have to look for another module ?
thanks
zmove
Comment #3
jpetso commentedIt's a missing feature, not sure if it can be implemented because when you initially create a node, imagefield doesn't know much of the required node data yet. The only thing we know for sure is the user who is logged in, which is why you can use user tokens. Maybe node tokens are doable as well (needs to be researched more in detail), but I imagine it'll take a while, if at all.
Comment #4
zmove commentedHum, I see...
It seems that the images are uploaded in the right path when the node is created, not before (cause when you upload imagefield and, finally, don't submit the node, the images are not uploaded).
So, if the images are moved from the temp directory to the final directory on the node creation, maybe it's possible to get the node title ?
Comment #5
baja_tz commentedsubscribe
Comment #6
baja_tz commentedI tried to add $node->nid to my file name, with this experimental code:
and it works for now, i tested it just few times. Works with lightbox and views. I'm not sure is there some problem with this (security or some others), if not I think it's not problem to implement it through module. I suppose it would be possible to add another node variables and change path too.
Comment #7
dopry commentedIf you had done your research on this feature you wouldn't be asking these questions....
1) You cannot know the path/url to the image on node creation if you base it on a non-existent node, even though the image isn't saved to it's final location until the node is saved.
2) In Drupal 6 the file is save to it's final location on upload and not node save.
3) Node metadata, all but node id, is mutable over time... Leading to potentially broken or misleading token paths in the future. IE) it is recipe for inconsistency.
I'm postponing for later review... I'm pretty sure this is also a duplicate of a won't fixed feature request.
Comment #8
dopry commentedI'd prefer proper site-date tokens be added to token modules. Once files can be shared the node specific data will be even less usable.
Comment #9
mrfelton commentedwould node creation date be possible? If it's new node, it'd just be todays date. Otherwise, the information would be stored in the node.