I have custom content type built in with module builder, which have image and content.
On the pages i drop widget displaying single item of that content. I want when using search widget results to show finded content item with image and link to page where the content is.
Any idea how to do that?
Something like attached picture for example.
Thanks, this will work for the image, but it won't work for getting url where the content is published even if I use GetItemLocations method. When I use mvc widget that is automatically generated by module builder and create my own or edit built in template GetItemLocations() return the pages where contentItem is published, but if I create my mvc widget and display the same content type GetItemLocations() does not return the pages.
This is my custom mvc widget probably I need to add something so when i call GetItemLocations() in search widget built in template as you say to return pages where is published?
var selectedContent = Model.CreateListViewModel(
ContentViewModel viewModel =
viewModel.Title = selectedContent.Fields.Title;
If you are using MVC search widget, you can add inside template something similar like this one:
"type of you dynamic item"
DynamicModuleManager dynamicModuleManager = DynamicModuleManager.GetManager();
Type type = TypeResolutionService.ResolveType(
var itemId =
var itemObject = dynamicModuleManager.GetDataItem(type,itemId);
For sure, you need to implement IContentLocatableView for your custom widget. You can check this article, which can help you: http://knowledgebase.progress.com/articles/Article/How-to-implement-IContentLocatableView-for-custom-widgets
Then, when u implemented it, you need to go to the page, where you placed this widget and republish this page. Because only in this case, Sitefinity will update content locations.
Then go to your dynamic module view on Backend and click "Pages where items like this are published" (attached image) and check if you page isexists. Also you can order the primary location of you dynamic item.
Then, reindex your search.
Hope, this will help for you