You are here

function npop_handler_field_npop::render_link in Node pop-up 7

Change node link to npop link to the query params.

Overrides views_handler_field_node::render_link

File

views/npop_handler_field_npop.inc, line 52
Views handlers for Node popup module.

Class

npop_handler_field_npop
A handler to provide a field that is completely custom by the administrator.

Code

function render_link($data, $values) {
  parent::render_link($data, $values);
  if (!empty($this->options['link_to_node']) && !empty($this->additional_fields['nid'])) {
    if (!empty($this->options['node_to_npop'])) {
      $nid = $this
        ->get_value($values, 'nid');
      $this->options['alter']['path'] = 'node/' . $nid;
      $this->options['alter']['link_attributes']['data-npop'] = $nid;
    }
  }
  return $data;
}