drupal 用视图页面替换默认节点

发布于 2024-11-03 13:21:43 字数 106 浏览 0 评论 0原文

我已经使用字段样式创建了一个页面视图,以根据需要显示预告片列表。视图中的字段配置允许我们将字段链接到它的节点。但是,如果我们已经为节点详细信息页面创建了视图,并且希望字段链接到其相关视图,该怎么办?

I have created a page view using field style to display a list of teasers as I want. fields configuration in views allows us to link the field to it's node. but what if we have created view for node detail page and want field to link to it's relevant view.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

想挽留 2024-11-10 13:21:43

我有同样的问题,经过一番研究后,我得出的结论是:

视图模块并不是要替换默认的节点视图。我这样说是因为这样做的难度很大,而且缺乏如何实现这一目标的信息。 Ryan Weal 发布了一种通过编辑节点模板来实现此目的的方法,该方法看起来并不难实现,这里是 链接

然而,这似乎是一个更流行的解决方案,特别是如果您像我一样并且不喜欢编辑主题文件。您可以使用 Display Suite 模块根据需要有效地重新格式化默认节点内容。

I had the same question, and after a bit of research this is what I've concluded:

The views module isn't intended to replace a default node view. I say this because of the level of difficulty involved in doing this and the lack of information on how to accomplish this. Ryan Weal has posted a way to accomplish this by editing your node template that doesn't look too difficult to accomplish, and here is the link.

However, it seems that a more popular solution, especially if you are like me and don't like to get into editing theme files. You can use the Display Suite module to effectively reformat the default node content as you would like.

失与倦" 2024-11-10 13:21:43

我不确定我是否正确理解您的意思,但听起来您想在节点的页面视图中显示视图?

为此,您可以:

  • 使用 hook_nodeapi() 或此函数的 D7 替换之一创建一个小模块,以便通过有条件地添加 $ 来将嵌入视图的输出插入到此页面的内容中当节点具有适当的 id 时的内容元素

  • 或(更简单,但需要允许输入类型 PHP)将视图嵌入到页面上。

http://thedrupalblog.com/embedding-view-drupal-6 -using-views-embed-view 有关嵌入视图的信息

I'm not sure if I understand you properly, but it sounds like you are wanting to display a view in a page view of a node?

In order to do this, you could:

  • create a small module, using hook_nodeapi() or one of the D7 replacements for this function in order to insert the output of the embedded view into this page's content, by conditionally adding a $content element when the node is of the appropriate id

  • or (easier, but requires allowing input type PHP) embed the view right on the page.

http://thedrupalblog.com/embedding-view-drupal-6-using-views-embed-view for information on embedding views

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文