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
.
- A
User
has two fields:Name
andAge
. - A
UserGroup
has three fields:User #1
,User #2
, andUser #3
.
Two questions:
The
User
template would make use of theSingle-line text
andInteger
field types. But forUserGroup
, what types would be used for theUser1
field (for instance)? Could I useUser
as a type? If not, does it make sense to store a GUID which points to the individualUser
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?