Copied to clipboard

Flag this post as spam?

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


  • Bruno 30 posts 50 karma points
    May 18, 2010 @ 19:14
    Bruno
    0

    how i can unpublish a content doxument by xsl?

    how i can unpublish a content doxument by xsl?

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    May 18, 2010 @ 19:39
    Douglas Robar
    0

    Unfortunately, that isn't possible directly from XSLT. You would need to use the umbraco API for that.

    umbraco.library.UnPublishSingleNode(sender.Id);

    This means you would either need to use a .net macro, or you could create an xslt extension (easy to do) to perform the action for you and then call that extension function from your xslt macro.

    cheers,
    doug.

  • Bruno 30 posts 50 karma points
    May 18, 2010 @ 20:02
    Bruno
    0

    So i need to create a user control and send the id of the document that i want unpublish.

    in user control use this "umbraco.library.UnPublishSingleNode(sender.Id);" with id of the document

    right?

    thanks and sorry for the english..

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    May 18, 2010 @ 20:21
    Dirk De Grave
    0

    Bruno,

    Creating a user control would be overkill here, as you'd write the same code in a small class xslt extension library. Latter doesn't need a user control, but will need some configuration to get it working.

    A good intro on xslt extensions can be found in the wiki... hmm, thought I'd find one there, but couldn't... and search isn't helping me much... but there's 3 free minutes in this video that may help

     

    Cheers,

    /Dirk

     

     

     

     

  • 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