In my Sitecore MVC project, is it possible to define a template for a Sitecore item in such a way that the content item is linked to some number of "sub-items"?
For example, say I want to define two templates - one called User
and another called UserGroup
.
User
has two fields: Name
and Age
. UserGroup
has three fields: User #1
, User #2
, and User #3
. Two questions:
The User
template would make use of the Single-line text
and Integer
field types. But for UserGroup
, what types would be used for the User1
field (for instance)? Could I use User
as a type? If not, does it make sense to store a GUID which points to the individual User
content items that I want to reference?
Is this approach considered an anti-pattern? Is it possible to pull off something like this by nesting the content items inside of each other in the Sitecore content tree? If so, how would the template have to be configured?
I suggest you to download launch Sitecore from http://launchsitecore.net/en/download and install it on a clean solution to see how others are structuring items in Sitecore.
Update
You can have next structure
User #1 , User #2 and User #3 have datasources: ./
If one user can be assign to multiple user groups I suggest to put all users under a global item and the User #1 , User #2 and User #3 will point to that item.