在 Drupal 6 中的块中创建内容

发布于 2024-09-06 06:54:47 字数 78 浏览 6 评论 0原文

默认情况下,创建内容时会打开一个新页面。我想在一个块内执行此操作。一个块,其中将包含一些字段,例如标题正文分类术语和创建内容按钮。我该怎么做?

By default for creating content a new page is opened. I want to do this inside a block. A block where there will be some fields like title body taxonomy terms and a create content button. How can I do this?

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

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

发布评论

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

评论(3

过潦 2024-09-13 06:54:47

表单块 模块将执行您想要的操作。

您可以在代码中执行相同的操作,使用 hook_block 创建块。并使用
drupal_get_form 呈现表单。

The form block module will do what you want.

You could you do the same thing in code, using hook_block to create a block. And using
drupal_get_form to render the form.

于我来说 2024-09-13 06:54:47

尝试面板模块。

http://drupal.org/project/panels

它可以让您覆盖并重新排列节点添加/编辑表单。

但是,正如 Jeremy 所说,要在网站的其他页面上使用此表单,您需要执行一些自定义操作,例如 hook_block 并调用 drupal_get_form。

Try the Panels module.

http://drupal.org/project/panels

It will let you override and re-arrange the node add/edit form.

But, as Jeremy stated, to use this form on other pages of the site you will need to do something custom like hook_block and invoke drupal_get_form.

帅气尐潴 2024-09-13 06:54:47

我同意杰里米和凯文的答案,但想给出另一个答案。

您可以使用视图来创建块!您所要做的就是创建一个带有块显示的新视图显示。添加要显示的字段,为 node/add/foo 链接添加链接字段,并为其指定节点 id 过滤器或默认参数。在这里您必须选择要在块中显示的节点的节点 ID。完毕!

这个解决方案有什么好处?您可以使用视图主题、拖放字段排序、添加新字段的几乎所有功能,成本低廉且无需额外模块。 ;)

问候

迈克

I agree with the answers from Jeremy and Kevin, but want to give another one.

You can use views to create the block! All you have to do is create a new view display with a block display. Add the fields you want to show, add a link field for the node/add/foo link and give it a node id filter or default argument. Here you have to choose the node id of the node to display in the block. Done!

What's nice with this solution? You can use almost every feature of views theming, drag and drop field ordering, adding new fields is cheap and no extra modules. ;)

Regards

Mike

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