Currently, views.getView will take the list of nodes returned by the specified view and will return the plain nodes corresponding to that list.

This patch adds a new views service method which allows for the retrieval of the ACTUAL fields/data returned by the view.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

brendoncrawford’s picture

Status: Fixed » Needs review

Please disregard the previous patch. I am posting a new patch which allows for complete and stable views integration.

I have also removed the field called "fields". It is no longer necessary since the view defines which fields should be outputted.

NOTE: I am deleting this patch for the more stable one in comment #3.

brmassa’s picture

Title: views_service: Adding Support for Actual View Output » views_service: Adding Better Support for Views Output
Category: feature » bug
Status: Needs review » Fixed

Brendon,

patch commited on CVS (for D6). Soon on the next release.

regards,

massa

brendoncrawford’s picture

massa,

Please disregard the last patch. Here is a much better, more stable patch that addresses some CCK issues with the views integration. Please use this patch instead.

brendoncrawford’s picture

brendoncrawford’s picture

And here is yet another patch which adds improved taxonomy fields support for views. Disreagdr the last patch and use this instead. I am making these diffs from the committed version, not from the last patch. if you need them diffed from my last patch, let me know.

brmassa’s picture

Status: Needs review » Fixed

Brendon,

i added your patch before, then i realized (and asked the opinion of Earl (merlinofchaos)) that the new Views dont generate only Nodes, but it might be users, taxonomies, comments... so i had to remove it.

But dont worry, the same results can be obtained using Views: just create a new "display", in which you select to for loading the entire node. Its much more elegant and generic.

but thanks.

regards,

massa

brendoncrawford’s picture

Status: Fixed » Active

Massa,

The new views_service release only outputs $view->result. This is simply the raw data, but it does not returned the actual rendered data. The most recent patch I posted shows an example of rendered data being outputted instead of just raw data.

It would only take about 10 minutes to make my most recent patch work for non-node views as well. I will make those changes and re-post it later today. Hopefully you could reconsider.

brmassa’s picture

Brendon,

you are right about $view->result being the raw data. However, instead of hardcode a node_load, user_load, taxonomy_load... which will impossible because any other module can create a new base, we need to create a new views' "display". It should basically "print" the actual data, which will be controlled by Views itself.

Can you try to do this? It should not be hard. I suggest studying some default Views' displays: "page", "feed", "attachment" and "block".

Sorry for placing it as fixed.

best regards,

,assa

brendoncrawford’s picture

Yes, I will give it a shot.

snelson’s picture

Status: Active » Closed (duplicate)

I think this is being attempted here now #329048: Better Views2 Support. Marking as duplicate so the discussion can continue over there.

gateway69’s picture

anyone done this for views3?