eZ Community » Forums » Developer » Self on Default selection item -...
expandshrink

Self on Default selection item - Object relation

Self on Default selection item - Object relation

Thursday 09 June 2011 7:54:37 pm - 3 replies

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?

Thursday 09 June 2011 8:34:10 pm

Hm, maybe you could use the object realtions datatype (note the plural) and then set "Template based, single" for the selection method.

Thursday 09 June 2011 8:42:26 pm

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 9:00:18 pm

The template you would be using is:

  • templates/node/view/objectrelationlist.tpl

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.

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from