views:

21

answers:

1

I am using this code in a views template to print user name in a field. The output is fine except it doesn't shows as a link, as its supposed to.

<?php print $row->users_name; ?>

How can i modify the code to show the output as a link? btw this was the comment in the template file which i cant decode.

  • Variables available:
    • $view: The view object
    • $field: The field handler object that can process the input
    • $row: The raw SQL result that can be used
    • $output: The processed output that will normally be used.

When fetching output from the $row, this construct should be used:

$data = $row->{$field->field_alias}
A: 

What does a dpr of $row->users_name show? Is it supposed to contain the correct HTML for a link?

If not then take a look at the l function - http://api.drupal.org/api/function/l

Like Martin says you should let us know where you want the link to point to.

digital