I'm trying to create a document, then create a document underneath it (as in the first or next child). But the script does'nt seem to see that the first document has been saved and published and as such does not want to add a doc under it ( in razor ).
Document newDoc =Document.MakeNew("A New Comment",DocumentType.GetByAlias("Comments"), umbraco.BusinessLogic.User.GetCurrent(), doc.Id); newDoc.Save(); newDoc.Publish(umbraco.BusinessLogic.User.GetCurrent()); umbraco.library.UpdateDocumentCache(newDoc.Id);
if(Model.Children.Where("nodeTypeAlias == \"Comments\"").Where("Visible").Count() > 0){ Make new document under the 'Comments' doc... }
Script not finding published doc
Hey all
I'm trying to create a document, then create a document underneath it (as in the first or next child). But the script does'nt seem to see that the first document has been saved and published and as such does not want to add a doc under it ( in razor ).
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.