Skip to content

Instantly share code, notes, and snippets.

@alvar0hurtad0
Created January 20, 2016 07:05
Show Gist options
  • Save alvar0hurtad0/f8dc7cfee10669104378 to your computer and use it in GitHub Desktop.
Save alvar0hurtad0/f8dc7cfee10669104378 to your computer and use it in GitHub Desktop.
/**
* Implements hook_views_post_execute.
*/
function points_of_sale_feature_views_post_execute(&$view){
if ($view->name == 'points_of_sale') {
switch ($view->current_display){
case 'where_to_buy_page':
// Put LOSAN Points of sale on the top of the list.
$temp_result = array();
foreach ($view->result as $key => $item){
if ($item->node_title == 'LOSAN'){
array_unshift($temp_result, $item);
}
else{
$temp_result[] = $item;
}
}
$view->result = $temp_result;
$view->display_handler->view->result = $temp_result;
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment