Connecting blocks on a page

Vote:
 

I’d like to connect 2 different block types on a page and am unsure of how to go about this.

I have a ContentArea TeamArea which holds TeamBlocks and a ContentArea ProfilesArea below this which holds ProfileBlocks. TeamBlock consists of a String TeamName, XhtmlString Description and a ContentArea TeamPhoto. The ProfileBlock has a String ProfileName, XhtmlString Biog, ContentArea Photo.

I’d like the TeamBlocks to be clickable showing the profiles of members of that team in the ProfilesArea. I understand it could be set up with multiple pages but as the team numbers grow this could lead to numerous pages all set up similarly. I think the 3 stages I need are:

  • add the team name to an array on creation of a team block
  • use this array to populate a drop down menu within the ProfileBlock so editors can assign the profile to the correct team
  • use IContentRepository to find all instances ProfileBlock
  • filter the results according to the team chosen

Am I going about this the right way? Any examples of something similar being down would be appreciated.

Thanks in advance,

Morag

#145585
Mar 07, 2016 17:20
Vote:
 

If one player can only belong to one team I would store the team as pages (not blocks) in page tree and then the profiles below that. Then you get that relation for free since you have the parent child relation. That takes care of data modelling part. For presentation I would probably let editors drag n drop the team and profile pages instead and do some partial views for them to display in content area.

For many to many relationships it gets trickier. I would probably store that either in dds or using EF and have a custom property to select teams a player belong to.

#145597
Mar 08, 2016 8:39
Vote:
 

Thanks for your response Daniel, I’m going with your recommendation.

I came across another post with someone working with a similar issue and the response was to do as you’ve suggested. My only issue with it is that it seems inefficient? For years we’ve been working towards separating content from design/layout and pulling database content into a single page programmatically. With EPiServer it feels like I’m back to creating multiple pages and subpages. I do see the benefits for the Editor – the edit side of the CMS is almost identical to the visitor’s view so information is logically easier to find.

Each person is a member of one team so I’ve no need for many to many relationships for this project but will be looking at the DDS and EF for a future project. Thanks again.

#145618
Mar 08, 2016 12:02
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.