开发者

Formatting views template output

开发者 https://www.devze.com 2022-12-21 18:27 出处:网络
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.

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

精彩评论

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

关注公众号