Created
August 17, 2011 17:21
-
-
Save gagarine/1152064 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function hook_views_pre_render(&$view) { | |
if ($view->name == 'ranges_by_room') { | |
//we order the view by node_node_data_field_pim_offer_title | |
//and we want the offer information only one time | |
$preview_offer = FALSE; | |
foreach ($view->result as $key => $value) { | |
if ($preview_offer == $view->result[$key]->node_node_data_field_pim_offer_nid) { | |
unset($view->result[$key]->node_node_data_field_pim_offer_node_data_field_pim_description_field_pim_description_value); | |
unset($view->result[$key]->node_node_data_field_pim_offer_node_data_field_pim_image_field_pim_image_value); | |
} | |
else { | |
$preview_offer = $view->result[$key]->node_node_data_field_pim_offer_nid; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment