I am creating an image gallery and the nodes for my images have a node reference to the gallery they are a part of. I wanted to place all the images in a folder with the node number for the gallery. I have set up the image file path field as gallery_images/[field_gallery_node-nid] but when I create the node the image isn't displayed because the token [field_gallery_node-nid] isn't being deferenced properly.
The image location in the node page is of the form .../image_display/gallery_images/[field_gallery_node-nid]/Picture%20221.jpg
Everywhere else the image displays properly; views, lightbox, etc.
If edit the node again and save it without changing anything the image is displayed correctly on the node page.
Any help will be appreciated.
Comments
Comment #1
decipheredHi preyer,
Sorry to take so long to get back to you but I have been on holidays.
Can you let me know what module(s) you are using to create the image gallery so that I can attempt to reproduce and resolve the issue?
Cheers,
Deciphered.
Comment #2
decipheredClosed due to inactivity.
Comment #3
emdalton commentedHi,
I have a similar problem with node reference tokens not being processed correctly.
I have a content type with two node reference fields, each pointing to a separate content type. I want to refer to data in the nodes referenced by these fields. According to the replacement token list, this path ought to work:
[field_archive_name_ref_nid]/[field_archive_provider_handle-raw]/[field_archive_series_handle-raw]
but all three tokens are left as-is rather than being correctly replaced. I tried with just [title] in the File Path parameter, and that works fine, so it's not my Filefield Paths setup.
The fields on my content type ("Document") are:
field_archive_name_ref - this is a node reference to type "Document Archive" with the default view settings, and should return the title of that node
field_archive_provider_handle - this is a CCK field on the "Document Archive" content type
field_archive_series_handle - this is a cck field on another referenced node, "Document Series" again default settings, should return the contents of this field.
These node reference links work in Views, and again, they are displayed in the replacement token list in the Workflow section of the Document content type, so I think this is a problem with the way Filefield Paths examines node references. You should be able to reproduce this problem as follows:
1 - Create two content types
2 - On content type A, create a field of type nodereference called contentbtitle and select content type B
3 - Put a CCK text field on Content Type B called contentbdata
4 - Check the replacement tokens in Content Type A for Upload Path settings. You should see the following:
[field_contentbtitle]
[field_contentbdata-raw]
But if you try to use these tokens to set the upload file path, they won't be properly replaced.
Thanks for any help! This module will meet our needs perfectly if we can get this resolved.
Comment #4
magnus commentedYou can only use node reference tokens. If you want to use tokens for other fields you have to write your own custom tokens.
See this thread http://drupal.org/node/483156#comment-2383702
Comment #5
magnus commented