Been having a play with the API and need to create a usercontrol that displays a list of unpublished nodes with a specific DocType - I then want to bind to a repeater or dataGrid?
Hmm, not sure if I'd want this in the frontend, but if you're using this from the backend, have a look at Richard's maintenance project, it'll help identifying the unpublished nodes, and may want to peek into the source to find out how he's done it.
Thanks Dirk, I had a look at that but Richard doesn't use the API to get them he makes a direct call to the DB - Was wondering it this was possible using the API? If not I'll have to use Richards solution?
you may want to consider tapping into the Umbraco data layer and query the DB directly for your nodes. This would return an IRecordsReader that you could then simply databind to a grid (or repeater or whatever you need).
Get List Of Unpublished Nodes Of Specific DocType
Been having a play with the API and need to create a usercontrol that displays a list of unpublished nodes with a specific DocType - I then want to bind to a repeater or dataGrid?
Anyone done anything similar?
Hmm, not sure if I'd want this in the frontend, but if you're using this from the backend, have a look at Richard's maintenance project, it'll help identifying the unpublished nodes, and may want to peek into the source to find out how he's done it.
Hope this helps.
Regards,
/Dirk
Thanks Dirk, I had a look at that but Richard doesn't use the API to get them he makes a direct call to the DB - Was wondering it this was possible using the API? If not I'll have to use Richards solution?
Hmmm ok first off I have tried to get the root which I have checked in the DB and seems to be correct as the ID is -1
Now I tried to loop through the children
But all I get is one Child? And it also has the ID of -1? A touch confused at the moment :S
Hi Lee,
you may want to consider tapping into the Umbraco data layer and query the DB directly for your nodes. This would return an IRecordsReader that you could then simply databind to a grid (or repeater or whatever you need).
Hth,
Nik
I think you and Dirk are right, after having a good look around it seems that this is going to have to be my option
Lee,
Reviving an old thread, but did this approach work for you? - I need to do the exact same thing (in a backoffice usercontrol).
Phil
Has somebody worked that out?
umbraco.uQuery.GetNode(id).Children - the result doesn't contain unpublished nodes
umbraco.uQuery.GetNodesByType("docTypeName") - the result doesn't contain unpublished nodes
Is there any chance to get ALL the nodes including the unpublished ones?
Yes, you have to use GetDocument.
This should do it, returning ALL nodes, including the unpublished:
is working on a reply...