Skip to main content

Posts

Showing posts from September, 2018

Keynotes for Solr Index in Sitecore 9

I've recently implemented a product list page and -as you can guess- I've needed to configure a custom index for my products. I will share some keynotes about that, I believe they might be useful for anyone who needs a similar thing. How to configure a custom index in Solr? Luckily, we already have a good article which shows how to create custom Solr indexes in Sitecore 9. I followed the steps and created my product indexes (my Sitecore version is 9.0.1). I added necessary fields and templates to my config file: <!-- Included fields --> <include hint= "list:AddIncludedField" > <Name> {A00DA813-46FF-47E4-ADD7-75C1333ACF32} </Name> <CommercialShortText> {0AFE5D2A-8172-46BA-BD96-FD6838E3D65B} </CommercialShortText> <TitleProductPage> {E7E6F859-F989-4BA3-8F31-7A03C9BD69E4} </TitleProductPage> <ProductDes

Working with Sitecore List Manager API (Version 9.0.1)

I've recently received a simple request to create a newsletter component. It was expected to get visitor's email, save it as contact and add it to newsletter list. I've found couple of example while searching but they were developed for old Sitecore versions. I was searching if there is useful API provided by Sitecore. And yes, I've found what I was looking for: The List Manager API var subscriptionService = ServiceLocator.ServiceProvider.GetService<ISubscriptionService>(); subscriptionService.Subscribe(contactListId, contactId); The code above seems clean and simple. But there is a problem: Where is that "ISubscriptionService"? There is no detail about which library we should use. I had a look at some of the libraries using dotPeek and found then. It is inside Sitecore.ListManager.XConnect This API has another useful method called "CreateSubscribedContact" to create contact but it was not suitable for my case. Because I was