向未注册用户显示节点标题
I'm using content access module to restrict certain nodes and node types for un-registered users.
But I would like to create a view where unregistered users can also see titles of those restricted nodes.
How can I do this ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我个人没有使用过这个,但几天前我刚刚看到它在 drupal.org 模块提要中弹出,它应该有所帮助:http://drupal.org/project/views_ignore_node_permissions
I haven't used this personally, but I just saw it pop up in the drupal.org module feed a few days ago, and it should help: http://drupal.org/project/views_ignore_node_permissions
好的,如果您只想在 php 中回显节点标题(在节点主体中)启用 php
然后 :
就完成了
ok if you just want to echo the node title in php (with in the node body ) enable php
then :
and you are done
如果您想限制对某些字段的访问而不限制对其他字段的访问,那么您确实应该使用每个字段的权限。我假设所有字段都是使用 CCK 构建的,因此只需启用内容类型的权限,但禁用所有字段。
这样,只有标题可见。我不认为你可以禁用标准主体字段的权限,但无论如何我总是使用 CCK 文本区域,对于 css 来说也更容易,因为标准主体字段没有包含在默认节点打印中。
If you want to restrict access to some fields and not to others, you really should be using permissions per field. I assume all fields are built with CCK, so just enable permission for the content-type, but disable for all fields.
That way, only the title is visible. I don't think you can disable permissions for the standard body field, but I always use a CCK text-area for that anyway, it's alot easier also for css since the standard body field isn't wrapped in default node printing.
您可以为此编写一个简单的模块,它执行以下操作:
在您的 hook_perm 中 可以创建一个新的权限来显示您想要显示的节点标题,如果它适用于所有人,只需使用“访问内容”即可。
You can write a simple module for this, which does the following:
in the hook_perm you can create a new permission who you would like to show the node titles, if it is for everybody, just use 'access content'.
解决方案位于此处:
The solution is here: