Tell me more ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I hav a strange task where I need to pull the content from a (well some) drupal view into an array so I can use that data later. I dont want to display contents right away, but I'll need to access it later.

I have already built the view but it was suggested that I can export the view and then create a module to grab the view data but I have no idea how to do that.

Basically what Im doing, is creating a view to pull say, 9 records of node type "blog" and on the front page, I want to pull that view, and therefor grab all the records in it so I can do stuff with the data.

share|improve this question

1 Answer

Not sure if it's what you're looking for, but if you're using a template to display that view, you can access an array of the view data by using the php code

$view->style_plugin->rendered_fields;

This will give you an array of everything that the view has returned.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.