November Happy Hour will be moved to Thursday December 5th.
AI OnAI Off
November Happy Hour will be moved to Thursday December 5th.
If you look at your variable e it has a property called Content. This is the content that is currently being saved.
Try casting it to ILocalizable and you can see which Language it is published in.
private void PublishContent(object sender, ContentEventArgs e) { var localizable = e.Content as ILocalizable; if (localizable == null) return; CultureInfo currentLanguage = localizable.Language; }
I have a custom function which is called on publish, similar to this article.
When PublishContent is hit, it is being passed SaveContentEventArgs instead of the parent ContentEventArgs.
Inside myClass.PublishEvent() I want to be able to get the language of the content being published. Is this possible? All the documentation points to using ContentLanguageEventArgs but there seems to be no way to pass that type instead of SaveContentEventArgs.
Using EPiServer 9.8