home | career | drupal | java | mac | mysql | perl | php | scala | uml | unix

Drupal example source code file (views_handler_field_node_path.inc)

This example Drupal source code file (views_handler_field_node_path.inc) is included in the DevDaily.com "Drupal Source Code Warehouse" project. The intent of this project is to help you "Learn Drupal by Example".

PHP - Drupal tags/keywords

as, directory, file, form, form_state, function, link, nid, php, return, this, url, values, you

The views_handler_field_node_path.inc Drupal example source code

// $Id:
 * Field handler to present the path to the node.
class views_handler_field_node_path extends views_handler_field {

  function option_definition() {
    $options = parent::option_definition();
    $options['absolute'] = array('default' => FALSE);

    return $options;

  function construct() {
    $this->additional_fields['nid'] = 'nid';

  function options_form(&$form, &$form_state) {
    parent::options_form($form, $form_state);
    $form['absolute'] = array(
      '#type' => 'checkbox',
      '#title' => t('Use absolute link (begins with "http://")'),
      '#default_value' => $this->options['absolute'],
      '#description' => t('If you want to use this as in "output this field as link" in "link path", you have to enabled this option.'),

  function query() {

  function render($values) {
    $nid = $values->{$this->aliases['nid']};
    return url("node/$nid", array('absolute' => $this->options['absolute']));

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal views_handler_field_node_path.inc source code file:

new blog posts

"Drupal" is a registered trademark of Dries Buytaert.

my drupal tutorials and examples  

Copyright 1998-2016 Alvin Alexander, alvinalexander.com
All Rights Reserved.

Beginning in 2016, a portion of the proceeds from pages under the '/drupal-code-examples/' URI will be donated to charity.