Arjen,
With the advent of the API, you can pretty much do anything you want- you are free from having to use the dotCMS backend to handle your structures. It's still there as a fallback.
You can make a form that can absolutely handle what you asking using just normal HTML + Javascript to interact. It can span multiple content structures on the same form.
So, yes, you could have a type field in the primary structure, and then that type can pull from a 'garden' structure OR a 'kitchen' structure. It can give you that second level of abstraction.
Let's try a second way - a SQL vision; now you can have different tables (Primary, Garden, Kitchen) and you can build a 'view' that merges them for interaction.
Here's code that allows a user to add a comment to a page (not being logged in) to report a typo or something like that. It even allows them to upload a file along side of it (like an image or a word doc) to accompany the comment. It uses some tricks ($VTLSERVLET_URI) to get the page url, and I set the page identifier in javascript on each page (ie. document.identifier='$dotPageContent.inode').
You'd need the other bits, but this is a working example.
function addcomment(){
var formData = new FormData();
request = new XMLHttpRequest();
request.onreadystatechange = function() {
if (request.readyState == 4){
if (request.status === 200) {
console.log("Create Eiffel Connect:");
console.log(request.responseText);
location.href="${VTLSERVLET_URI}?dotcache=refresh";
} else {
console.log("Error", request.statusText);
}
}
};
request.open("POST", "/api/content/publish/1", true);
var comment=document.getElementById('Comment').value;
var d=new Date();
var mon=d.getMonth()+1;
var day=d.getDay()-1;
var atime=d.getFullYear()+"-"+mon+"-"+day+" "+d.getHours()+":"+d.getMinutes()+":"+d.getSeconds();
console.log(atime);
//User, PageUrl,Identifier, Highlight, Comment, Reported, ResolvedBy, Resolved
var dataObj={
'stName':'ParisContentComment',
'identifier1' : document.identifier,
'pageurl' : '$VTLSERVLET_URI',
'user' : '$reviewuser',
'useremail' : '$reviewemail',
'userdepartment' : '$reviewdept',
'userjob' : '$reviewjob',
'highlight' : document.highlit,
'comment' : comment,
'reported': atime,
'contentHost':'SYSTEM_HOST'};
formData.append('json',JSON.stringify(dataObj));
var theimager=document.getElementById('tpic');
var file=theimager.files[0];
if (file)
formData.append("document", file);
request.send(formData);
}
Mark