Skip to content

Instantly share code, notes, and snippets.

@tmbritton
Created October 11, 2012 20:29
Show Gist options
  • Save tmbritton/3875273 to your computer and use it in GitHub Desktop.
Save tmbritton/3875273 to your computer and use it in GitHub Desktop.
Drupal sort view by NIDs supplied as an argument
$args = $view->args[0];
$exploded = explode('+',$args);
$flipped = array_flip($exploded);
if($flipped[$row1->nid] < $flipped[$row2->nid]) {
return 0;
} else {
return 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment