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 found that publishWithSubs method just can publish first level nodes of the parent node.
how can i publish all the unpublished nodes under one parent node? no matter how deepth the unpublished nodes are.
I'm not familiar with the "publishWithSubs" method but could you loop through the children of the parent document instead and recursively publish every child document?
I say "Document" instead of "Node" because I think only a document can be published, a node is already a published version of the underlying document, see http://our.umbraco.org/wiki/reference/api-cheatsheet/difference-between-node-and-document.
For example you could have a method that calls itself, once you call it initially on your parent document. Something like:
// get a document version of your nodeDocument parentDoc = new Document(node.Id);// where parentDoc is your parent Documentthis.PublishChildDocs(parentDoc);
protected void PublishChildDocs(Document doc)
// loop through all child documents in the doc, recursively calling this method
foreach (Document childDoc in doc.Children)
Hi. Probably this will work:
Some drawback may be that the whole umbraco.config will be rebuilt, though.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted