开发者

How to incorporate a CCK form and view into a single page in Drupal

Using Drupal 6.

I've created a new node type with CCK, which has one form field, in text, limited to 120 characters. The title is hidden by the node_autotitles module, and the body is removed by removing the body field name in the node settings.

I also have a view that displays all nodes of this type on a page view.

What I would like to do is consolidate things so that the user can fill in this node form on the view page, and have it refresh or something similar so they can see the updated page. I guess it's like a shoutbox, but I don't want to install a new module for all of this, I would like to see how it's possible us开发者_JS百科ing what I've created.

Any ideas?


you can do it via blocks. create some page, let's say shoutbox, then create 2 blocks and put them to content or content_bottom region (it depends on your theme). in first block output form using custom php code in second one, display your view with nodes.


You can use the formblock module for achieving this, putting the node creation form in your view page. For putting the form in your view, you can use context, panels, o whatever you're using. Or just create a module and put the form in the #prefix of the view with hook_views_prerender and drupal_get_form.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜