Looking for good blog posts / documentation on Master/Detail

Posted by Community Admin on 03-Aug-2018 20:16

Looking for good blog posts / documentation on Master/Detail widgets

All Replies

Posted by Community Admin on 16-Nov-2012 00:00

I don't feel like I understand how a widget handles Master/Detail views very well. I have worked with them, and gotten them to work, but I don't feel like I understand them fully. Has anyone documented them well on a blog post, or have some good example code I should review to better understand them? How did you learn master/detail widgets?

I am very comfortable with the concepts involved. I *think* my misunderstanding is with the internal routing that occurs when a widget has more than one view.

Posted by Community Admin on 21-Nov-2012 00:00

Hi Dan,

I assume you are talking about the widgets of the built-in modules (News, BlogPosts, etc.) They all inherit from ContentView and have child views in them. Master-detail scenarios are handled by knowing when to load which child view. Let's take the News widget as an example (NewsView class).

It has two child views - NewsMasterView and NewsDetailView. When you put it on a page, the widget itself has to decide whether to render in master or detail mode. It makes this decision based on several factors:

  • The ContentViewDisplayMode property
  • The current URL

If the ContentViewDisplayMode property is Master, the widget always renders in master mode. It shows all items of the required type (NewsItem). If the property is Detail, the widget always renders in detail mode. The item which is rendered is taken based on the DataItemId property of the detail view definition. If the ContentViewDisplayMode property is Automatic, the widget decides based on the URL.

If the URL segment after the current page corresponds to a URL of an item of the required type (in this case NewsItem), the widget renders that item in detail mode. If it doesn't, the widget renders in master mode.

For more information on how the widgets handle URLs, you can read the following blog posts:
Url Filtering in Built-in Content Widgets
Url Filtering with Multiple Content Widgets per Page

I hope this sheds some light on the master-detail scenarios

Kind regards,
Slavo
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed