使用视图附加或嵌入节点添加表单

Attach or embed node add form with a view(使用视图附加或嵌入节点添加表单)

本文介绍了使用视图附加或嵌入节点添加表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Drupal 7.54.我想将节点添加表单附加或嵌入到视图中,以便当用户提交表单时,表单下方的视图将通过 ajax 实时更新.表单将显示在视图上方.我的视图块名称是 Statuses Stream.

I am using Drupal 7.54. I want to attach or embed a node add form to a view so that when a user submits the form, the view below the form will be updated in realtime via ajax. The form will be shown above the view. My view block name is Statuses Stream.

我尝试了 表单块 模块并将表单放在我的视图的标题部分使用查看 ui,但提交后,它正在重定向到节点创建的页面.

I tried Form block module and putting the form in the header section of my view using views ui, but after submit, it was redirecting to the node created page.

然后我尝试了 高级表单块 模块.我使用 AFB 模块创建了一个表单.表单名称为Statuses.它使用 ajax 提交表单,但没有实时更新视图.我必须手动刷新页面才能在表单下方显示创建的节点.

Then I tried Advanced Form Block module. I created a form using AFB module. The form name is Statuses. It is submitting the form with ajax, but it is not updating the view in the realtime. I have to refresh the page manually to show the created node below the form.

我愿意以编程方式或通过模块解决任何解决方案.

I am open to any solution programmatically or through a module.

注意:对于那些知道的人,我试图模仿 statuses 模块.它完全符合我的要求.当我知道它不是一个实体时,问题就开始了.所以现在我正在尝试使用 Content 类型实现相同的功能.

Note: For those who know, I am trying to mimic the statuses module. It does exactly what I am looking for. The problem began when I came to know that it is not an entity. So now I am trying to make the same functionality with Content type.

推荐答案

你可以使用类似 视图刷新 手动更新下面的视图而不是刷新页面.

You could use something like Views Refresh to manually update the view below instead of refreshing the page.

这篇关于使用视图附加或嵌入节点添加表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:使用视图附加或嵌入节点添加表单

基础教程推荐