Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.0-beta2
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
9 May 2008 at 16:38 UTC
Updated:
2 Nov 2013 at 00:30 UTC
Jump to comment: Most recent
Comments
Comment #1
merlinofchaos commentedYou should probably just call ->build() rather than ->render().
That said, I don't understand why $view->result would not contain the data you need. It's the raw data, of course, not the rendered data (in either case) but $view->result is the only thing that will provide what it sounds like you're looking for.
Comment #2
merlinofchaos commentedComment #3
domesticat commentedPerforming a mass closing of all issues over 180 days old. Please reopen if needed.
Comment #4
hassan.abudu commentedReopening, now with more detail.
I'm trying to output the views result as XML. I'd like to get an array of the results, manipulate them, and then theme the final results as XML at the end. I'm getting the result array of the view by doing this:
The result of this is:
But if instead of $view->result I do:
This is the result list:
In other words, if none of the multiple value fields are displayed, nor (bizarrely), the Open in New Window field. I think this is the issue the threadstarter saw.
I've been looking through the views code, but I can't for the life of me see how the display handler is fetching those extra results. If anyone knows more about this issue, keep us all posted.
Also, I'm thinking of theming the $view->render() results, and then parsing out the data I want. I don't want to create a separate views template, as simple_link_view() returns a view that is dynamically generated. Any assistance would be much appreciated.
Regards,
Hassan
Comment #5
merlinofchaos commentedThe display handler does not fetch those extra results, the field handlers do, and they use the pre_render() method to do it.
You might also look at $view->style_plugin->rendered_fields() after you call $view->render().
Comment #6
hassan.abudu commentedThanks very much! I couldn't call rendered_fields like a function, but as a variable, it worked like a charm. :-)
One last question as part of the array of results, I get:
[field_simpleurl_value] => <div class="field-item field-item-0">www.abc.com</div><div class="field-item field-item-1">www.cnn.com</div>Is there a way to theme these rows using real-time functions instead of tpl.php files?
Comment #7
merlinofchaos commentedUnfortunately I'm afraid not. That markup, I think those are actually being themed by CCK anyway, so you'd have to intercept its theming.
Comment #8
hassan.abudu commentedThanks for all your help!