I think that NodebyID is for the older versions of Umbraco, but i'd like to get my website up and running. This is the last thing I need before I think the functionality of my website is complete. I will go back and optimize it later. var nodes = Model.NodeById(1195).Children();
This will display all children nodes under a certain folder. -Beginner -Article1 -Article2 -Article3
and
var nodes2 = Model.NodeById(1201).Children(); This will do the same thing.
-Intermediate -Article1 -Article2 -Article3
I would like to display all children from both cateigories. NodesbyID will just show be Intermediate and Beginner folders but not actually the children.
Thank you Jivan for your response. Unfortunately that is not working because I am using a Razor macro rather than MVC. I'm still trying to wrap my head around all of this, sorry!
How to merge two NodebyID into one variable?
I am using Umbraco and I would like to add two variables together that will display articles in both children.
It's not working and throwing an error. Is there another way to do this? I found this on the forum board, but It doesn't seem to work for me.
link: http://our.umbraco.org/forum/developers/razor/47078-how-to-merger-DynamicNode?p=0#comment168589
Have you try
what version of umbraco are you using?
I am using Umbraco 7.1.7 with MVC.
I think that NodebyID is for the older versions of Umbraco, but i'd like to get my website up and running. This is the last thing I need before I think the functionality of my website is complete. I will go back and optimize it later.
var nodes = Model.NodeById(1195).Children();
This will display all children nodes under a certain folder.
-Beginner
-Article1
-Article2
-Article3
and
var nodes2 = Model.NodeById(1201).Children();
This will do the same thing.
-Intermediate
-Article1
-Article2
-Article3
I would like to display all children from both cateigories.
NodesbyID will just show be Intermediate and Beginner folders but not actually the children.
This may work, I have not tested.
or
// or if there is only child items under 1195, and 1201 nodes
Hi Mygel,
Here is a way where you get the children of 2 nodes,
Hope this helps,
/Dennis
Thank you Jivan for your response. Unfortunately that is not working because I am using a Razor macro rather than MVC. I'm still trying to wrap my head around all of this, sorry!
Here is my work so far if this helps anyone
http://pastebin.com/jdFrUXJu ;
Hi, Mygel,
You need to inherit the view page from
Hi Mygel,
If you are using the old DynamicNode razor, you can do it like this:
I think that you should consider one day to have a look at the Partial view or Partial view macros, because the DynamicNode razor is deprecated. And it´s is not so hard to convert the DynamicNode razor to Dynamic razor or strongly typed razor. To get an idea on how to convert the DynamicNode to Dynamic Razor see this documentation in the bottom of the page. http://our.umbraco.org/documentation/Reference/Templating/Macros/Partial-View-Macros/
Hope this helps,
/Dennis
is working on a reply...