Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#5 | brendoncrawford-views_service.module.2.patch | 3.13 KB | brendoncrawford |
#3 | brendoncrawford-views_service.module.1.patch | 2.41 KB | brendoncrawford |
views_service.module.1.patch | 2.21 KB | brendoncrawford | |
Comments
Comment #1
brendoncrawford CreditAttribution: brendoncrawford commentedPlease 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.
Comment #2
brmassa CreditAttribution: brmassa commentedBrendon,
patch commited on CVS (for D6). Soon on the next release.
regards,
massa
Comment #3
brendoncrawford CreditAttribution: brendoncrawford commentedmassa,
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.
Comment #4
brendoncrawford CreditAttribution: brendoncrawford commentedComment #5
brendoncrawford CreditAttribution: brendoncrawford commentedAnd 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.
Comment #6
brmassa CreditAttribution: brmassa commentedBrendon,
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
Comment #7
brendoncrawford CreditAttribution: brendoncrawford commentedMassa,
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.
Comment #8
brmassa CreditAttribution: brmassa commentedBrendon,
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
Comment #9
brendoncrawford CreditAttribution: brendoncrawford commentedYes, I will give it a shot.
Comment #10
snelson CreditAttribution: snelson commentedI think this is being attempted here now #329048: Better Views2 Support. Marking as duplicate so the discussion can continue over there.
Comment #11
gateway69 CreditAttribution: gateway69 commentedanyone done this for views3?