Skip to main content
added 11 characters in body
Source Link
niksmac
  • 7.7k
  • 3
  • 31
  • 69

How do I alter the output of an existing views handler?

I want to alter views_handler_field_user_picture() to get the link to the user profile, not the themed picture.

See alter existing handlers (handler overrides). I expect a link like this http://cdn.sstatic.net/drupal/img/logo.png.

function mymodule_views_data_alter(&$data) {
  $data['users']['field']['handler']$data['users']['picture']['field']['handler'] = 'my_custom_handler';
}

module .info

files[] = user_picture_formatter.inc

and user_picture_formatter.inc is like this

<?php
class my_custom_handler extends views_handler_field_user_picture {
  function render($values) {
    if ($picture_fid = $this->get_value($values)) {
      $picture = file_load($picture_fid);
      $picture_filepath = $picture->uri;
    }
    else {
      $picture_filepath = variable_get('user_picture_default', '');
    }
    return $picture_filepath;
  }
}
?>

How do I alter the output of an existing views handler?

I want to alter views_handler_field_user_picture() to get the link to the user profile, not the themed picture.

See alter existing handlers (handler overrides). I expect a link like this http://cdn.sstatic.net/drupal/img/logo.png.

function mymodule_views_data_alter(&$data) {
  $data['users']['field']['handler'] = 'my_custom_handler';
}

module .info

files[] = user_picture_formatter.inc

and user_picture_formatter.inc is like this

<?php
class my_custom_handler extends views_handler_field_user_picture {
  function render($values) {
    if ($picture_fid = $this->get_value($values)) {
      $picture = file_load($picture_fid);
      $picture_filepath = $picture->uri;
    }
    else {
      $picture_filepath = variable_get('user_picture_default', '');
    }
    return $picture_filepath;
  }
}
?>

How do I alter the output of an existing views handler?

I want to alter views_handler_field_user_picture() to get the link to the user profile, not the themed picture.

See alter existing handlers (handler overrides). I expect a link like this http://cdn.sstatic.net/drupal/img/logo.png.

function mymodule_views_data_alter(&$data) {
  $data['users']['picture']['field']['handler'] = 'my_custom_handler';
}

module .info

files[] = user_picture_formatter.inc

and user_picture_formatter.inc is like this

<?php
class my_custom_handler extends views_handler_field_user_picture {
  function render($values) {
    if ($picture_fid = $this->get_value($values)) {
      $picture = file_load($picture_fid);
      $picture_filepath = $picture->uri;
    }
    else {
      $picture_filepath = variable_get('user_picture_default', '');
    }
    return $picture_filepath;
  }
}
?>
added 672 characters in body
Source Link
niksmac
  • 7.7k
  • 3
  • 31
  • 69

How do I alter the output of an existing views handler?

I want to alter views_handler_field_user_picture() to get the link to the user profile, not the themed picture.

See alter existing handlers (handler overrides). I expect a link like this http://cdn.sstatic.net/drupal/img/logo.png.

function mymodule_views_data_alter(&$data) {
  $data['users']['field']['handler'] = 'my_custom_handler';
}

module .info

files[] = user_picture_formatter.inc

and user_picture_formatter.inc is like this

<?php
class my_custom_handler extends views_handler_field_user_picture {
  function render($values) {
    if ($picture_fid = $this->get_value($values)) {
      $picture = file_load($picture_fid);
      $picture_filepath = $picture->uri;
    }
    else {
      $picture_filepath = variable_get('user_picture_default', '');
    }
    return $picture_filepath;
  }
}
?>

How do I alter the output of an existing views handler?

I want to alter views_handler_field_user_picture() to get the link to the user profile, not the themed picture.

See alter existing handlers (handler overrides). I expect a link like this http://cdn.sstatic.net/drupal/img/logo.png.

How do I alter the output of an existing views handler?

I want to alter views_handler_field_user_picture() to get the link to the user profile, not the themed picture.

See alter existing handlers (handler overrides). I expect a link like this http://cdn.sstatic.net/drupal/img/logo.png.

function mymodule_views_data_alter(&$data) {
  $data['users']['field']['handler'] = 'my_custom_handler';
}

module .info

files[] = user_picture_formatter.inc

and user_picture_formatter.inc is like this

<?php
class my_custom_handler extends views_handler_field_user_picture {
  function render($values) {
    if ($picture_fid = $this->get_value($values)) {
      $picture = file_load($picture_fid);
      $picture_filepath = $picture->uri;
    }
    else {
      $picture_filepath = variable_get('user_picture_default', '');
    }
    return $picture_filepath;
  }
}
?>
added 67 characters in body; edited title
Source Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

How todo I alter the output of an existing views handler?

How todo I alter the output of an existing views handler  ?

iI want to alter views_handler_field_user_picture() to get the link to the user profile, not the themed picture.

ReadSee http://drupal.org/node/872780alter existing handlers (handler overrides)

 . I expect a link like this

http://cdn.sstatic.net/drupal/img/logo.png

Is there http://cdn.sstatic.net/drupal/img/logo.png.

How to alter existing views handler?

How to alter an existing views handler  ?

i want to alter views_handler_field_user_picture to get the link to user profile not the themed picture.

Read http://drupal.org/node/872780

  I expect a link like this

http://cdn.sstatic.net/drupal/img/logo.png

Is there

How do I alter the output of an existing views handler?

How do I alter the output of an existing views handler?

I want to alter views_handler_field_user_picture() to get the link to the user profile, not the themed picture.

See alter existing handlers (handler overrides). I expect a link like this http://cdn.sstatic.net/drupal/img/logo.png.

added 141 characters in body; edited title
Source Link
niksmac
  • 7.7k
  • 3
  • 31
  • 69
Loading
Source Link
niksmac
  • 7.7k
  • 3
  • 31
  • 69
Loading