开发者

Formatting views template output

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开发者_JAVA技巧 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}


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜