Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Hi,
If you use SavingContent event then you could modify the content properties before they will be saved.
But you are using PublishedContent event - setting properties here without explicit saving content has no effect.
The GetForceCurrentVersionSaveAction() extension method is not responsible for saving content. It's just returns the proper SaveAction for content instance.
I think that you could try to use:
ServiceLocator.Current.GetInstance<IContentRepository>() .Save(productPage, productPage.GetForceCurrentVersionSaveAction());
I would like to get some related products, when publishing a product page. I've specified some product categories, so two product are related products if they have at least one common category.
I've tried the following:
- get product pages with same categories as the actual page to be published. I've the following code: