如何在Drupal中为匿名用户隐藏价格和add_to_cart选项?
我认为,您可以转到admin/peoples/permissions页面,取消选中匿名选项。
要隐藏字段,可以创建节点--YOUR_CONTENT_TYPE.tpl.php
在此模板中,您可以检查用户角色:
global $user;
// Check if the user has the 'authenticated user' role.
if (in_array('authenticated user', $user->roles)) {
//show your field
}
此外,你总是可以隐藏css-)
.未登录。YOUR_CLASS_FIELD{display:none;}