Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have made a mistake on a customers websitet where I need to import 15000 products to different categories.
The import is working fine but now is the problem that we need to remove all unpublished nodes of a specific type.
I can get all published nodes like this
var node = Umbraco.Content(1056); var products = node.DescendantsOfType("product");
But I cant see the unpublished like that - any ideas?
Hi Niels
For unpublished nodes, you have to go either via Examine and the InternalIndex, or loop through nodes using the ContentService.
Hi Niels.
The UmbracoContext.Content.GetById, takes a bool of preview so you should be able to get unpublished nodes with that.
Hope it helps a little and you can use it.
Regards Malthe
is working on a reply...
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.
Continue discussion
How to get all unpublished nodes?
I have made a mistake on a customers websitet where I need to import 15000 products to different categories.
The import is working fine but now is the problem that we need to remove all unpublished nodes of a specific type.
I can get all published nodes like this
But I cant see the unpublished like that - any ideas?
Hi Niels
For unpublished nodes, you have to go either via Examine and the InternalIndex, or loop through nodes using the ContentService.
Hi Niels.
The UmbracoContext.Content.GetById, takes a bool of preview so you should be able to get unpublished nodes with that.
Hope it helps a little and you can use it.
Regards Malthe
is working on a reply...
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.