Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function my_module_views_query_alter(&$view, &$query) {
- if ($view->name == 'my_view') {
- $node = node_load($nid);
- //setting a value from my actual node, into a variable
- $field_frequency = $node->field_frequency['und'][0]['value'];
- //testing add where function:
- // $papa = $query->fields['nid']['field'];
- // $query->add_where(0, $papa , '17144', '=');
- // it works!!
- //time to compare the field frecuency from my actual node with all the fields from my view
- $view_frecuency = $query->fields['field_data_field_frequency_node_entity_type']['field'];
- $query->add_where(0, $view_frecuency , $field_frequencyday, '=');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement