Best Practice? How to do Master / Detail Widgets in Sitefinity
I'm trying to figure out a good way to integrate a custom widget with master/detail views into a Sitefinity page. (for example: a list of store locations (master) & full location detail (details))
In the end, I would like visitors to be able to bookmark a specific location's URL. Therefore, a combined master/detail widget that uses AJAX for navigation may not work. So how would you construct this type of widget in Sitefinity?
1. Setup two (or more) Sitefinity pages: master widget on one, detail page on other(s) - pass id through url param? Other means?
2. One Sitefinity page, widget with master/detail combined, switch using AJAX? (Can the URL be bookmarked? indexed?)
3. One Sitefinity page, widget with master/detail combined, switch using url param? id in url path? other?
4. Other method?
Thank you for your feedback.
Hello Dan Sorensen,
I would go for option 2 or 3. The advantage of option 3 is that it can be eventually crawled by search engines, since all master's will have unique url-s. Option 2 can also provide unique url with the unique part in the url hash number, but this is not crawlable. In this case you will have to load the details on the client side load event of the page. The advantage of option 2 is that your widget can be entirely based on web-service and client side data binding, and so the page will not reload from server - which can result in better and faster user experience. If you still need full-text search I think it is possible in theory to tweak our Sitefinity search indexing to work with hashes or maybe more simple way is to tweak the search results control to return hashes rather than urls.
Nikolay Datchev
the Telerik team
Hi Nikolay Datchev,
Can you share some sample code how to achieve this?
Thanks!
Hello Alex,
Options 1 and 3 are already implemented in Sitefinity and you can use them out of the box. You can use the Module builder to create a dynamic module with type Store and drop its widget to a page. In this way you will achieve option 3. If you need different pages for master and details view (option 1) you need to configure your widget to use different page for a detail view (Single Item Settings tab -> Select existing page…). The both options can be achieved without a single line of custom code. If you need some custom logic you can map external templates and place there your custom code.
According to option 2 you will need custom development to implement web service invocation and partial rendering.
I hope this information would be helpful for you. Please do not hesitate to contact me again if you need any further details.
Regards,
Georgi Dimitrov
Telerik