How can I get publishing cultures from 'INotificationHandler<ContentPublishingNotification>'
I success to get the published cultures from "INotificationHandler <ContentPublishedNotification>".
But how can I take it from "INotificationHandler<ContentPublishingNotification>"?
Thanks a lot
var unpublishingCultures = publishedItem.AvailableCultures.Where(culture => notification.HasUnpublishedCulture(publishedItem, culture)).ToList();
var publishingCultures = publishedItem.AvailableCultures.Where(culture => notification.HasPublishedCulture(publishedItem, culture)).ToList();
The code about get the published cultures from INotificationHandler ContentPublishedNotification.
Hi Jacob, did you figured it out. I am looking for a solution on how to get the list of cultures selected while saveandpublish content in a publishedNotification.
How can I get publishing cultures from 'INotificationHandler<ContentPublishingNotification>'
I success to get the published cultures from "INotificationHandler <ContentPublishedNotification>". But how can I take it from "INotificationHandler<ContentPublishingNotification>"?
Thanks a lot
Hi Jacob, did you figured it out. I am looking for a solution on how to get the list of cultures selected while saveandpublish content in a publishedNotification.
Hi Ramya
There are Extension Helpers for ContentPublishingNotification and for ContentPublishedNotification, you can discover them here in the source:
https://github.com/umbraco/Umbraco-CMS/blob/86697ff137ab6a35d5279f4c1d6991093e1bb54c/src/Umbraco.Core/Notifications/ContentNotificationExtensions.cs#L25C18-L28C43
So Looks like there is a helper for
IsPublishingCulture (when publishing) and HasPublishedCulture (when published)
So you can use these in either notification to check which of the Available Culture Is 'Publishing' or Has 'Published'.
regards
Marc
is working on a reply...