You are here

function npop_handler_field_npop_link::render_link in Node pop-up 7

Apply our colorbox-node class and add width and height to the query params.

Overrides views_handler_field_node_link::render_link

File

views/npop_handler_field_npop_link.inc, line 48
Views handlers for Node popup(npop) module.

Class

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

Code

function render_link($node, $values) {
  if (!empty($this->options['node_to_npop']) && node_access('view', $node)) {
    $this->options['alter']['make_link'] = TRUE;
    $this->options['alter']['path'] = 'node/' . $node->nid;
    $text = !empty($this->options['text']) ? $this->options['text'] : t('view');
    $this->options['alter']['link_attributes']['data-npop'] = $node->nid;
    return $text;
  }
  return parent::render_link($node, $values);
}