Copied to clipboard

Flag this post as spam?

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


  • Yetiish 6 posts 91 karma points
    Jul 28, 2014 @ 16:22
    Yetiish
    0

    Reload content tree from non content section using code behind

    Hi,

     

    I am working with uCommerce, and from a pipeline I would like to reload the content tree in the content section. So essentially, I need to force a reload of the content tree, when the content section is not the active section.

    I have tried a varienty of methods, but had no luck witth any.

    umbraco.library.RefreshContent();

    It seems that a way to make it work might be to use the ClientTools. i.e:

    ClientTools ct = new ClientTools((Page)HttpContext.Current.CurrentHandler);
    ct.SyncTree(ApplicationContext.Current.Services.ContentService.GetById(content.Id).Path, true);

    However, this appears to require the CurrentHandler to be the content section. Given that the active section is not the Content section, are there any suggestions how I could get the content as Page? Or are there any other solutions to this issue that i'm missing that do not require ClientTools?

     

Please Sign in or register to post replies

Write your reply to:

Draft