Drupal - 视图 +节点预览问题
我的 Drupal 6 站点上有一些视图,它们负责处理节点的某些字段。
例如,我有一个名为 Country 的内容类型,其中有一个名为 Capital 的字段。我已在节点显示中排除了该字段,但有一个视图将节点 ID 作为参数并将其显示在右列中。这一切都非常漂亮,并且对我来说效果很好,但是我如何处理节点预览模式呢?由于节点尚未保存,Capital 字段还没有新值。
注意:我准备做一些非常肮脏的黑客来完成这项工作:)
I have a few Views on my Drupal 6 site which take care of some of a node's fields.
For example, I have a content type called Country, which has a field called Capital. I've excluded this field in the node display, but there is a view that takes the node ID as an argument and displays it in the right column. This is all very pretty and has been working out well for me, but how do I take care of the node preview mode? Since the node isn't saved yet, the Capital field won't have its new value yet.
Note: I am ready to do some very dirty hacks to make this work :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不要破解 drupal! :)
不那么简单和未经检查的想法之一:
在自定义模块中使用 hook_form_alter 或 hook_nodeapi 进行验证,您应该看到新的大写字段的数据,将其保存在某处(例如,保存到会话中),并通过主题视图字段将其显示到块中。
don't hack drupal! :)
One of not so simple and unchecked idea:
use hook_form_alter or hook_nodeapi with validate in custom module, there's you should see data of new capital field, save it somewhere (for example, into sessions), and show it's into block via theming Views field.