Gosh, I feel I somehow will embarass myself pressing the "submit" button but having looked at the forum and API still cannot figure out what the answer is. What I'm trying to do is get all nodes that are of a specific doctype:
But this returns an empty array with striking regularity. I looked at an earlier post by Niels (http://forum.umbraco.org/yaf_postst8558_getAllUniqueNodeIdsFromObjectType.aspx) but still not sure what he means.
Is there a way to do what I want with some consise magic or do I need to iterate over all nodes the good ol' way? Apologies if it's something obvious, today marks my first contact with the Umbraco API.
Let me answer my own question before someone chips in :-) Just as Niels said, and as I finally got to understand, unique id is not a doctype as we know it. User-created doctypes too uniqueIDs too. But getAllUniqueNodeIdsFromObjectType only filters over a field descibing a much more general "doctype" id, one that was created "before all time" - eg. a "webpage", a "macro", a "stylesheet". So pluging a unique id of a user doctype will always result in an empty result set.
Perhaps something along the lines of how I initially understood the method will be possible one day :-) But until then it's good ol' recursion.
List all nodeIds by document type
Gosh, I feel I somehow will embarass myself pressing the "submit" button but having looked at the forum and API still cannot figure out what the answer is. What I'm trying to do is get all nodes that are of a specific doctype:
But this returns an empty array with striking regularity. I looked at an earlier post by Niels (http://forum.umbraco.org/yaf_postst8558_getAllUniqueNodeIdsFromObjectType.aspx) but still not sure what he means.
Is there a way to do what I want with some consise magic or do I need to iterate over all nodes the good ol' way? Apologies if it's something obvious, today marks my first contact with the Umbraco API.
Let me answer my own question before someone chips in :-) Just as Niels said, and as I finally got to understand, unique id is not a doctype as we know it. User-created doctypes too uniqueIDs too. But getAllUniqueNodeIdsFromObjectType only filters over a field descibing a much more general "doctype" id, one that was created "before all time" - eg. a "webpage", a "macro", a "stylesheet". So pluging a unique id of a user doctype will always result in an empty result set.
Perhaps something along the lines of how I initially understood the method will be possible one day :-) But until then it's good ol' recursion.
Are you looking to get the NodeIds of all published content nodes by their DocumentType Alias?
In that case you can do this:
/Dennis Milandt
Hi,
above, the example is for published nodes, however i need the oposite ( Not published )..
What i need change for get that?
thanks
is working on a reply...