开发者

Creating sub-nodes in Drupal from a single node form

I would like to have a special "sub-node" that could be attached to other Drupal nodes, that allows authors to include commentary (from the author, so this isn't a comment node) and sample text, to the parent node.

I plan to use the exact same fields for the author commentary and sample text, and to create a view that lists both together. So,开发者_Go百科 it would be OK to use the same node type for both the author commentary and sample text, or at least the same fields. This might also be useful for having an "address" node that could be attached to various nodes and then displayed together on a listing page.

I think the solution would include using node reference fields, but I get tripped up when it comes to theming the parent node form.

My question is similar to this one:

Create multiple CCK nodes with single custom form in Drupal


I think the best way to do this would be to create a view to display nodes that use the node reference field. It's tricky the first time you do it, but easy once you understand how views arguments work.

I found this helpful http://drupal.org/node/161867

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜