I need to make a content creation form that ties in the creation of two different content types.
cars as an example. There is a one-to-many relationship between
cars, so one
garage can have 0 to many
I've created the content types and established the relationship between them but I need to figure out how to best support the user in creating content. I think it is important that distinction between content types is more or less transparent to the user, so he could be creating his garage at one point, then later on come back to add cars. Or he could be creating a garage and adding two cars in one go. Or he could go in and create a car without even assigning a garage.
I imagine accomplishing this by having a form for adding garages and a form for adding cars, but near the end of the 'create garage' form I have the option of either assigning an existing car I have created earlier (probably using an autocomplete textfield) or load the 'create car' form in a modal window allowing to create a new car right before submitting the garage form (the relatioship will then be established right away).
My question is how to accomplish this best from an architectural point of view.
Should I write a completely custom module and maybe place it in a block with panels or could I get by simply by creating a hook that changes the content creation forms for cars and garages? Or maybe you know about a contrib module that fixes this for me out of the box?
Furthermore, I imagine the end result being soaked in asynchronous requests, allowing the form to be validated and saved asynchronously. For an early proof-of-concept I could live with "nested save buttons", though. I will most likely be using AngularJS for some of the realtime stuff. Should I look into exposing the content types as a REST service build and the entire page in AngularJS right away? (something I am planning to do further down the line anyway, but I also need to have something up and running quickly and I imagine a rewrite for Drupal 8 in a not too far future. So I would prefer not having to learn how to build services in Drupal 7).