Master/Detail w/ sub form

Events happening in the community are now at Drupal community events on www.drupal.org.
newz2000's picture

Hi,

I'm considering building an app and wondering if this thing can be done easily in Drupal or if it would be stretching the way Drupal works.

Basically, I want to create a node and then attach additional nodes to it. In my case the attached nodes are images and file uploads (probably using image cache and filefield.

However, I want there to be a clear link that these attachments are directly associated with this new node. And there will be a lot of nodes like this. I will never want to use the attachments except when I'm using the node they're attached to. There will be a variable number of attachments - sometimes zero, sometimes two, sometimes 30 or more.

Thoughts?

Comments

RE: Master/Detail w/ sub form

jeffiet's picture

I'd be interested to know other peoples thoughts as well...

I've tried this using cck, nodereference, views, rules and panels, but it very quickly got to a point where I felt I was stretching Drupal and those modules beyond their limits.

I ultimately was able to display a panel that showed the master/detail relationships the way I wanted. The hard part came when I tried to add a new 'detail' node and getting the corresponding 'master' nodereference populated correctly and then getting the save of the 'detail' to get back to the correct 'master' panel.

I tried some things with php entries on panels to save the "state" of things, i.e. which 'master' to redirect to after adding a 'detail'. But I never got it to a point where it seemed "production ready". (I was actually trying several levels of master-detail, where even the details could be a master to other details.) Managing the "state" and the "flow" from master to detail and then back to the master seemed to take way to much Drupal configuration with the views, rules and panels needed to make it worth it.

I get the sense some of this would be just as easy to build from scratch using a php framework like Cake or Symfony with their scaffolding and admin functionality, respectively.

But I certainly allow that I was going about it in the wrong way. Drupal has surprised me before.

Popup: Add and Reference

scottatdrake's picture

Popup: Add and Reference looks like it might make the process of adding new "detail" nodes smoother, though I've never tried it.

I think there are some other helper-style modules for CCK's Node Reference field but I'm blanking out on them right now...

Also, are using the word "panel" as in the Panels Module?

Node Reference

scottatdrake's picture

"I will never want to use the attachments except when I'm using the node they're attached to."

When I hear that, I wonder why you couldn't just add image and filefield CCK fields to that content type. You can specify whether or not you want to allow (or require) 0, 1, or unlimited numbers of them.

On the other hand...

If you want to be able to add these attachments independently of add/editing the parent(?) node, I'm thinking you should look at CCK Node Reference which "Defines a field type for referencing one node from another." When creating an image/file node, there will be a field that lets you reference whatever parent(?) node you want. Then, using views or views attachments, you can display those related images/attachments along with the parent node. (If that makes any sense at all. :)

I forgot about that...

newz2000's picture

Ah, I forgot there was an unlimted option there. I've never used it before but I will check that out. It may work perfectly.

--
Matthew Nuzum
newz2000 on freenode

Yes, when I said "panel" I

jeffiet's picture

Yes, when I said "panel" I was referring to the panels module.

Central Iowa Drupal Users Group

Group categories

Category

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: