Forums / Developer / Self on Default selection item - Object relation
Sao Tavi
Thursday 09 June 2011 10:54:37 am
I need to be able to allow the editors to select one object as default "content" for the parent.
So... The editors will be able to add more children to an object and to select one of these children as default "behavior" for the parent. The problem is that I want to restrict the options to the children of the current object and not allow them to browse for it in another objects.
Is this possible through the options or do I need to create a custom datatype?
Marko Žmak
Thursday 09 June 2011 11:34:10 am
Hm, maybe you could use the object realtions datatype (note the plural) and then set "Template based, single" for the selection method.
-- Nothing is impossible. Not if you can imagine it! Hubert Farnsworth
Thursday 09 June 2011 11:42:26 am
Thank you, Marko
I didn't knew that that option exists.
Anyway, as I had really close to what I needed, I alredy created the new datatype. On the other hand, wouldn't changing the template change the functionality of these datatype site wide?
Thursday 09 June 2011 12:00:18 pm
The template you would be using is:
and since it's a node view templates I suppose the same override keys are applied. So you shold be able to use different templates for different classes.
Maybe also the attribute identifier could be used as the override key, but you should dig a little bit more to find that out.