Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • jacob-sbn 3 posts 82 karma points
    May 15, 2023 @ 01:21

    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.
  • Ramya Devendiran 25 posts 146 karma points
    Sep 20, 2023 @ 13:25
    Ramya Devendiran

    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.

  • Marc Goodson 2046 posts 13490 karma points MVP 8x c-trib
    Sep 20, 2023 @ 14:19
    Marc Goodson

    Hi Ramya

    There are Extension Helpers for ContentPublishingNotification and for ContentPublishedNotification, you can discover them here in the source:

    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'.



Please Sign in or register to post replies

Write your reply to: