Copied to clipboard

Flag this post as spam?

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


  • Jaimster08 4 posts 74 karma points
    Aug 04, 2021 @ 18:19
    Jaimster08
    0

    Set Node to unpublish by ID?

    So I need my code to unpublish a node when they add it to the basket. I've got the ID of the node page but I don't know how to unpublish it? could I set the expire date to -1? or is there a specific way?

  • Renante 9 posts 125 karma points
    Aug 05, 2021 @ 04:56
    Renante
    0

    Hi, I think that is possible with this method.

    var cs = Services.ContentService;
    cs.Unpublish(cs.GetById(PAGE_ID));
    

    where PAGE_ID is your node page ID.

Please Sign in or register to post replies

Write your reply to:

Draft