By WoozyDuck on
Hi all,
I am using CCK Image module and want to show those images using a customized view (Views module)
When I use (print_r) to get available arrays I get the following value for image field:
[node_data_field_small_image_field_small_image_title] => globe_66.jpg
Well everything is fine up to this level, but this actually doesn't show me the actual path of the image, and it is only the filename! how can I get the full path string?
Many thanks in advance
Luca
Comments
Perhaps this will help
I assume you're using imagefield for CCK -
I'm guessing your field name is field_small_image - but you should double-check that.
You can try the following to return the path of the first image in the array (If it's a multi-value field there may be more):
Let me know if that worked for you!
------------------------------
http://fraggles.artsci.wustl.edu (Drupal user documentation and development blog)
Didn't work
Thank you for your reply but I actually don't get that array
All I get from that field is the following items:
[node_data_field_small_image_field_small_image_fid] => 637
[node_data_field_small_image_field_small_image_title] => globe_66.jpg
[node_data_field_small_image_field_small_image_alt] => Globe
Would it be possible to get the full path of the image using (node_data_field_small_image_field_small_image_fid) somehow?
Many thanks
Done!
I am not sure if Drupal had any core function to get the filepath using FID (FileID) but I just got it using the following query:
The result would give me the full file path of the image :)
Sorry - somehow missed the part about this being in a view..
I use the array function I provided to get the filepath in template.php. I set it as a variable so I can use it as background images outside of the node area. Strange that the filepath variable was excluded from the array in the view!
------------------------------
http://fraggles.artsci.wustl.edu (Drupal user documentation and development blog)
Thank you very very much!
Thank you very very much!
Done!
I am not sure if Drupal had any core function to get the filepath using FID (FileID) but I just got it using the following query:
The result would give me the full file path of the image :)
Done!
I am not sure if Drupal had any core function to get the filepath using FID (FileID) but I just got it using the following query:
The result would give me the full file path of the image :)
%s --> %d
$fid is a integer.
would be more appropriate.
Thank you
Thank you very much :)
MEntaL
So there's no other way to get an image path ina view. Mental.
Sometimes I'm not sure about this Drupal malarky.
I found this, which was quite helpful http://2bits.com/articles/drupal-using-imagecache-with-views-and-cck-ima...
Image problem
Greetings!
I am using cck image file field module and it's dependensies. I have a form developed with cck field types. When I upload am image with the image fieldtype it only shows me a small image on the form. What I want is that when the user clicks on the small image he should view a full size verison of that image that is its actual size. I also use image link module but cant get the functionality.
If node is an option then how can the form make a node automatically when it uploads a file while filling the form.
Please tell me some steps since I am a complete beginner and have no idea of php.
Many Thanks
Best Regards
Well thanks to that link, I
Well thanks to that link, I learned you can use field_file_load ... no need for db queries or anything. There's a bit more info on the 2bits.com site if you are interested.
I used it like this to call a view from php: