1
votes

I'm trying to find some functionality that is somewhere between the Container Part and the Taxonomy Field.

What I'd like to do is say that Foo has a field which contains many of Bar. There are two varieties of this, the one to many and many to many. Let's just stick to the simpler one to many version.

At first pass I thought the Container might work, but it seems that a content type is limited to one container part (at least it is through the GUI admin). That means that I can't have foo.products and foo.locations (that'd be two Containers in the same ContentType.)

What might work would be a container field, but I don't see that one of those is available.

The Taxonomy Module might work but that requires that I create Bar as a taxonomy. Then go to content types and add parts to the Bar Term. This just doesn't feel right and it requires that I recreate a bunch of content types as taxonomies.

I think I could achieve this if there were a taxonomy part that I could add to foo, but unfortunately I don't see one of those either.

Maybe I should just bite the bullet and create a custom module with my domain model, but I thought I'd ask here first.

thx, Dan

2

2 Answers

3
votes

I think you need to read this if you are going to roll your own: http://orchardproject.net/docs/Creating-1-n-and-n-n-relations.ashx

Alternatively, there is a module on the gallery that might work for you: http://orchardproject.net/gallery/List/Modules/Orchard.Module.Downplay.Mechanics

1
votes

Have you looked at the tags module? It allows you to have multiple tags against a content item. You could write your own module that implements a more restrictive interface, wrapping some of the tags functionality in a custom content part that restricts tags to those within a certain set, provides an admin controller that lets you edit the subset of tags.

If that won't work for you then you might be better off writing your own module. It sounds like both Taxonomies and Lists both implement some functionality you want but not all, so you should be able to use both of those modules as a reference and/or solid foundation for your own.