0

OK, here is my setup, i will then explain what im trying to achieve:

I have a content type of DELIVERY another content type of BOOK and another content type of FEEDBACK

Now, any given user can have anywhere from 1 to 12 DELIVERY content types created (these are created using Rules automatically when they sign up). I use the Node Reference field to attach a BOOK to the DELIVERY content type, if the user has more than 1 delivery content, i will be attaching different books to each delivery content each month. When i attach a book to the users delivery, they can then create a FEEDBACK content to leave feedback under that particular DELIVERY.

So for example,

User 1 
  - Delivery 1 
       - Book 1 
       - Book 2 
  - Deliver 2 
       - Book 3

I want the user to be able to create a Feedback content and select the relevant book that the feedback belongs to and once saved it should appear under the particular delivery content.

How can I achieve this?

  • Do you have a question? – chrisjlee Apr 19 '13 at 15:59
0

You should be able to add a node reference field on the Feedback content type. When your user creates a new Feedback node, they should be able to select the correct Delivery node to associate it with.

You will most likely want to constrain the user's selection options to Delivery nodes associated with that particular user so that User 1 doesn't leave feedback about User 2's delivery. One way to do this is to create a custom autocomplete function and use hook_form_alter() to edit the Delivery node reference field on the Feedback node create/edit form.

On a Delivery node, to display Feedback nodes that are associated with that Delivery node, you can create a View that has shows Feedback nodes that are associated with the currently logged in user and references the current node nid (use contextual filters for both).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.