继续Drupal分享精神 QQ群:107748121 站长QQ:2275288328 skype: hellodrupal【drupal交流+drupal 建站+theme制作】
登录 注册

Drupal 文章开头像,drupal comment 开启头像功能

drupal 发布文章里可以加入作者的头像,或者在对一篇文章评论的时候
添加评论者的头像。
头像主要使用的变量。可以在node.tpl.php 和comment.tpl.php里面看到
使用的是
<?php print $picture ;?> 这就是输出头像的变量,而是带衔接的。
要使用这个变量。必须在后台主题管理里面,设置开启文章头像和评论头像功能。选中即可。
如果你不想这样麻烦,
那直接就可以在tpl.php里面使用下面代码输出用户头像途径:

<?php
print $node->picture; //输出结构是sites/xxxx/xxx.jpg 头像路径
?>

把路径代码加入 就可以了。

评论

发表新评论

此内容将保密,不会被其他人看见。
  • 自动将网址与电子邮件地址转变为链接。
  • 自动断行和分段。
  • You can use BBCode tags in the text.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

更多关於格式化选项的信息

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.