Sort view before print

Events happening in the community are now at Drupal community events on www.drupal.org.
ludo1960's picture

Hello

Got as far as running a query grabbing a bunch of nids and passing them to a view, thought I was doing well! However you guessed it, the sort order is wrong, here's my pseudo code:

//query to grab the nids

if (!empty($nodeids)) {
$view='taxo_listing';
foreach ($nodeids as $nid){
print views_embed_view($view, block_1, $nid);
}

What I need to do is pre-build the view then run views_query_alter to sort the view before printing out the view.

Been looking at http://views.doc.logrus.com/ for a while now, but it's all a bit confusing, can anyone offer any clues as how to go about this? I know what I want to do but unsure how to go about it, sound familiar guys?

Thanks in advance.

Views Developers

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: