2

I already found Get "Raw" views data (with no or little markup), but it wasn't, what I was looking for. I really do need the raw fields for having them differently styled in a module. Because the view itself should just be styled like it is, when navigating to it as page. But my module should be able to read the fields in raw-style. Or do I have to clone a view in order to be able to read the raw format?

2

Your module can load and execute the view itself. You can get the results from the view without changing the display.

// Load the view
$myview = views_get_view('my_view');
// Set arguments if you need to
$myview->set_arguments(array($code));
// Execute the query
$myview->execute();        
// Loop over the results
foreach ($myview->result as $row) {
  // The fields are properties of the row
  $x = $row->my_field;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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