jsonrpc, services and views - need to have imagefield filename in response that is NOT node type.

Events happening in the community are now at Drupal community events on www.drupal.org.
roo's picture

I saw this mentioned a few times in various posts, but could not find a solution.

If I utilise a view in "node" format, then I do indeed get the imagefield file information required to load the image. HOWEVER, I also get a number of large "blob" style text field contents as the entire node is returned, this requires much more bandwidth (3x more) for each item, at least. Thus making the call slow and wasting time and bandwidth. I also cannot determine how to get fivestar rating values to be returned for each node in the "node" format option.

I can get the fields I require (thus making the download lean and efficient), and get the fivestar rating if I choose "fields" for the output style. However, as you are aware, this style only returns a "fid" and other useless information for the imagefield.

So, how do I have my cake AND eat it? I need to select only certain fields, I need to get the fivestar rating, AND I need the filename for any included cck imagefields I include.

I am presuming I need to patch views_service.inc to navigate through the $result and for each node, find any cck imagefield, and append another field to that node representation that has the filename extracted via loading the file from the fid?

Surely someone has done this before?

Thanks,
Andrew

Services

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: