Copied to clipboard

Flag this post as spam?

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


  • andrew shearer 409 posts 517 karma points
    Jan 27, 2014 @ 05:03
    andrew shearer
    0

    ContentService Published event in umbraco 6.1.6

    hi

    I have a scenario where I have a set of category nodes (Red, Blue Green etc) and when one of these nodes is published I want to conditionally update some other content nodes in the tree.

    I have the published event wired up using

    ContentService.Published += Published;
    
    private void Published(IPublishingStrategy sender, PublishEventArgs<IContent> args)
    

    This is working as intended, but my question is how to obtain the list of category nodes during this event that includes the updates to the category that was just published? I tried using the content cache but it seems that hasn’t been updated yet:

    UmbracoContext.Current.ContentCache.GetByXPath("//Categories/Category"); 
    

    Thanks

  • Jeroen Breuer 4861 posts 12138 karma points MVP 3x admin c-trib
    Jan 27, 2014 @ 12:06
  • andrew shearer 409 posts 517 karma points
    Feb 11, 2014 @ 20:41
    andrew shearer
    0

    another way to phrase my question might be at what point/event after publishing content can i use "ContentCache.GetByXPath" and have it use the newly published item/s? thanks

     

  • andrew shearer 409 posts 517 karma points
    Feb 11, 2014 @ 21:55
    andrew shearer
    0

    or is it bad practice to use both ContentService and ContentCache in unison?

  • andrew shearer 409 posts 517 karma points
    Oct 04, 2015 @ 21:22
    andrew shearer
    0

    hi - does anyone have a solution to this? thanks

  • andrew shearer 409 posts 517 karma points
    Oct 04, 2015 @ 21:27
    andrew shearer
    0

    maybe another way to phrase my question is after which contentservice event can i use the cache file and expect the cache file to contain the item being published? (on umbraco 7.2)

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies