imagefield path to url missing
erichomanchuk@f... - April 30, 2009 - 18:36
| Project: | Views Datasource |
| Version: | 6.x-1.0-alpha2 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | allisterbeharry |
| Status: | active |
Jump to:
Description
I am trying to get a url path from the image field that I have in my content. All I end up getting is a serialized string for it, e.g. 'node_data_field_image_field_image_data:a:2:{s:3:"alt";s:0:"";s:5:"title";s:0:"";}' when I unserialized it, it just has the title and alt attributes. I have the image field set to URL to file and the view shows the url to the files but the xml datasource does not.
I want to be able to use the URL in a flash gallery that uses this xml from my portfolio content.
Does anyone know a workaround for this, I just want the URL path.
Thanks.

#1
I spent ages banging my head against a wall, but figured it out in the end. Of course a node is not going to contain all of the information if it is linked across multiple tables through CCK, image attachment or by some other means. So if you are attaching images or relating them to other content types, you will need to define the relationship within your view.
My steps:
In the views UI control panel I defined a relationship, in my case it was to the new content type which I had created.
Then in fields there was another option of group of fields to choose from (in my case it was 'file'). I then specified the specific field I was after, File:Path.
Voila! I hope that helps.
#2
THATS IT!
Thanks a lot this was bugging me too. I thought It was some stupid issue with cck and views but it actually makes sense why you need to define the relationship. I was about to go crazy and start hacking the module, glad I don't have too.
Thanks again.
#3
I think this is the same root problem I'm having at http://drupal.org/node/459628 ; but my relationship options are only taxonomy/parent term, node revision, and some comment ones; when I need content connections
#4
Could you give some more details on your View - what fields do you want to pull in? I'll try to recreate it and see if I can help.
#5
The issue I see with #1 is that it doesn't work with imagecache. Additionally, it won't honor when you rewrite the path in the view field settings, nor if you use a 'global custom text' field.
#6
seems it might be nice somehow to specify (per field, i suppose) whether to output a field's value or its output in the json.
#7
#8
this is exactly the issue I am having. I still have to figure out how the relationship part works. did you ever get this to work with ImageCache?
I think its strange that a normal view will display an ImageCache url... but not in JSON.
#9
i am still having no luck doing what you suggested here. can you add some other pointers?
I am trying to display the ImageCache images as file URL's .
And any other suggestions would be nice.