【问题标题】:How to customize User points section in user profiles如何在用户配置文件中自定义用户点部分
【发布时间】:2010-07-29 18:05:40
【问题描述】:

我正在使用用户点模块,该模块将用户点选项卡添加到用户配置文件中。

我想从用户个人资料中的用户积分选项卡中删除链接“查看”,只留下分数。

我正在寻找使用主题开发者模块的模板: http://dl.dropbox.com/u/72686/userpoints.png

但是,模板 user-profile-item.tpl.php 只包含:

<dt<?php print $attributes; ?>><?php print $title; ?></dt>
<dd<?php print $attributes; ?>><?php print $value; ?></dd>

我不能用它做很多事情。

模板仅包含:

<div class="profile">
  <?php print $user_profile; ?>
</div>

那么,我需要修改用户点在用户配置文件中的显示方式的模板在哪里?

谢谢

【问题讨论】:

    标签: drupal drupal-6


    【解决方案1】:

    用户个人资料有点棘手,因为它太通用了。在这种情况下,您不想更改标记而是更改实际内容。

    你可以这样做。

    • 使用hook_preprocess_user_profile 可以更改使用的值
    • 自己实现hook_user,并覆盖用户积分模块提供的数据以删除不需要的链接。 (它们仅在您获得许可的情况下可用)

    【讨论】:

    • +1 - 查看userpoints_user() 操作'view' 实现,可以看到'View' 链接是直接从代码中添加的,因此没有机会在主题级别更改它。最好只复制部分并使用调整后的副本覆盖模块本身的输出。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-09-08
    • 2017-02-10
    • 2011-10-30
    • 1970-01-01
    • 1970-01-01
    • 2014-09-06
    • 2022-12-04
    相关资源
    最近更新 更多