Unpublish link

Topics: Administration
Dec 15, 2011 at 5:27 PM
Edited Dec 18, 2011 at 1:53 PM

Hi,

I'm trying to create an unpublish link with 

 

@Html.Link(T("Unpublish").Text, Url.Action("Unpublish", "Admin", new { area = "Contents", id = Model.Id, returnUrl = Request.ToUrlString() }), new { itemprop = "UnpublishUrl UnsafeUrl" })

 

which I copied from Orchard.Web\Core\Contents\Views\Parts.Contents.Publish.SummaryAdmin.cshtml.

But when I clicked this link, it redirect to HTTP 404.

Did I miss something?

Can you suggest how to do this?

Thank you in advance.

Coordinator
Jan 6, 2012 at 1:18 AM

Why not an ActionLink? What is the url that you see it generated?

Jan 3, 2013 at 7:51 PM
Edited Jan 3, 2013 at 8:03 PM

I know this post is old, so I am raising the dead a little bit. I am trying to, also, create an unpublish link. Where I differ from the OP, I am just trying to use an "<a>" tag. I got the direct URL to unpublish from the content page, it reads:

http://server/Contents/Unpublish/1010?returnUrl=http%3A%2F%2Fserver%2FAdmin%2FContents%2FList

I try to go there by just copy and pasting that link to my browser and I get a 404 not found. I tried taking the rest of the ?returnUrl out and I get the same thing. My goal with all of this is to have an unpublish button on the front-end of the page using this content item. Any help is appreciated!