I have the following data structure on my website:
Homepage
Smartphones
>Reviews
Laptops
>Reviews
I have reviews nested under the 'smartphones' and 'laptops' which are children of the homepage..
I currently know how to get just the smartphone and laptop reviews seperately, but I want to be able to display both the smartphone and laptops together as one section, any advice how I can go about this?
I've currently been using this:
var node = new Node(1102).GetDescendantNodes();
And then checking the nodeTypeAlias. However I've attempted to do this to pull all of the data, but it doesn't apepar to work :[
uQuery and INode are essentially obsolete, you should be using
IPublishedContent everywhere.
However it works, just keep in consideration for future upgrades. I know they are loosing a lot of old code in Umbraco 8, so maybe uQuery disapears? Not sure.
Thank you for the replies, and your time replying to my question,
I got this working with uQuery suggested by Manish,
I will however look into the other methods suggested if It happens to become deprecated in later versions - @Dennis, thanks for pointing this out to me.
Retrieve All Nodes
I have the following data structure on my website:
Homepage
I have reviews nested under the 'smartphones' and 'laptops' which are children of the homepage..
I currently know how to get just the smartphone and laptop reviews seperately, but I want to be able to display both the smartphone and laptops together as one section, any advice how I can go about this?
I've currently been using this:
var node = new Node(1102).GetDescendantNodes();
And then checking the nodeTypeAlias. However I've attempted to do this to pull all of the data, but it doesn't apepar to work :[
Any help will be much appreciated thanks!
Hi TechRadiance.
Have i understood you correctly that you want to get all Review nodes no matter where they are located in your sites content-tree?
Hi TechRadiance
We can also get node by it's document type
Thanks
Just remember that uQuery is obsolete.
Shannon Deminick wrote in https://our.umbraco.org/forum/developers/api-questions/45777-uQuery-vs-Examine-vs-IPublishedContent-for-Querying:
However it works, just keep in consideration for future upgrades. I know they are loosing a lot of old code in Umbraco 8, so maybe uQuery disapears? Not sure.
Hi TechRadiance
You can also use the umbraco Helper method to achieve this by grabbing all nodes by document type alias.
This is given that the document type alias for the Review nodes is called Review.
Hi,
Thank you for the replies, and your time replying to my question,
I got this working with uQuery suggested by Manish,
I will however look into the other methods suggested if It happens to become deprecated in later versions - @Dennis, thanks for pointing this out to me.
Thanks again,
Alex
is working on a reply...