You are here

function npop_create_link in Node pop-up 7

Generate and return link, that open node in popup window.

Parameters

string $title: Link title.

int $nid: ID of node which must opened in popup window.

array $options: (optional) An associative array of additional URL options to pass to url().

Return value

string html link generated from params.

File

./npop.module, line 271
Create popup nodes with ajax and Drupal core functionality.

Code

function npop_create_link($title, $nid, array $options = array()) {
  $options['attributes']['data-npop'] = $nid;
  $parent = request_path();
  if ($parent) {
    $options['query']['parent'] = $parent;
  }
  return l($title, 'node/' . $nid, $options);
}