Might sound like a terse comment but is the no way at all you can re-evaluate your node structure theres an aweful lot of nesting there (just me but i thought too much) if you can explain the object acheived by your current approach we could suggest a different way. Just trying to be helpful ;) disregard if you like.
Scenario is that i have one document type is for question.
second document type is for answer.after that i allow answer document type below question and answer too.
now i create one question it have multiple reply and reply of reply.
Question(parent Document type)
reply 1(child Document type)
reply 1.1(child Document type)
reply 1.1.1(child Document type)
Up to n level reply of reply (child Document type)
reply 2(child Document type)
reply 2.1(child Document type)
reply 2.1.1(child Document type)
Up to n level reply of reply (child Document type)
now i need to display
reply 1
reply 1.1
reply1.1.1
up-to n levels
reply 2
reply 2.1
reply 2.1.1
up-to n levels
for that i use umbraco helper but it gives me upto 11 levels after that it gives an error as mansion in question .
Thanks for your explanation can i ask in simple terms what sort of system is it you are devising? FAQ? forum? Interview transcript? Just trying to get my head round this and it helps to know the big picture
If you want to display things in a hierarchy then you will need to use the children method however your code illustration just shows a flat list of links in which case you could use 'descendants' instead how many levels are in the item causing the error? What happens if you put a breakpoint on the loop and step through looking closely at the state of 'item' at level 10 and 11. I don't know if you need to put some checks in to see if item has children before trying to iterate. For one reason or an other you are running out of memory often caused by an infinite recursion but i don't know if that is possible in your case.
I would also say you are using dynamic published content rather than typed content which is easier when it comes to accessing properties but if you are looping through a lot of content then there may be a lot of properties there you dont need taking memory when you can just access those you want on typed content with GetPropertyValue('propertyalias') I believe though the performance overhead is normally supposed to be minimal so it may not make a difference.
I would consider using something more like relationships than a fully structured tree as you are currently configuring it. If you work on the tree approach you will most likely always find a stack overflow limit due to the nature of dynamically evaluating an expression like that.
In addition, I would consider not using Umbraco content nodes for each response. Each response would result in a republish of the site cache, an in turn result on a massive cached XML file on disk.
Helpers traverse throwing error at Level 11
Hello all,
I have following structure of node.
Content
ParentNode
Now i have written below code (Using traverse) to display it in my page.
The above code works only if the Parent node has children upto Level 10
If i have Level 11, then i am getting below error: {Cannot evaluate expression because the current thread is in a stack overflow state.}
Can anyone please help me out to display the above list in my page?
Any suggestion would be appreciated.
Might sound like a terse comment but is the no way at all you can re-evaluate your node structure theres an aweful lot of nesting there (just me but i thought too much) if you can explain the object acheived by your current approach we could suggest a different way. Just trying to be helpful ;) disregard if you like.
Hello lan
Thanks for your quick reply
Scenario is that i have one document type is for question. second document type is for answer.after that i allow answer document type below question and answer too. now i create one question it have multiple reply and reply of reply.
now i need to display
reply 1
reply 1.1
reply1.1.1
up-to n levels
reply 2
reply 2.1
reply 2.1.1
up-to n levels
for that i use umbraco helper but it gives me upto 11 levels after that it gives an error as mansion in question .
is there any way to get the n level of nodes.
Thanks.
Thanks for your explanation can i ask in simple terms what sort of system is it you are devising? FAQ? forum? Interview transcript? Just trying to get my head round this and it helps to know the big picture
I'm devising a system bit like a Forum type. Thanks.
If you want to display things in a hierarchy then you will need to use the children method however your code illustration just shows a flat list of links in which case you could use 'descendants' instead how many levels are in the item causing the error? What happens if you put a breakpoint on the loop and step through looking closely at the state of 'item' at level 10 and 11. I don't know if you need to put some checks in to see if item has children before trying to iterate. For one reason or an other you are running out of memory often caused by an infinite recursion but i don't know if that is possible in your case.
I would also say you are using dynamic published content rather than typed content which is easier when it comes to accessing properties but if you are looping through a lot of content then there may be a lot of properties there you dont need taking memory when you can just access those you want on typed content with GetPropertyValue('propertyalias') I believe though the performance overhead is normally supposed to be minimal so it may not make a difference.
I would consider using something more like relationships than a fully structured tree as you are currently configuring it. If you work on the tree approach you will most likely always find a stack overflow limit due to the nature of dynamically evaluating an expression like that.
In addition, I would consider not using Umbraco content nodes for each response. Each response would result in a republish of the site cache, an in turn result on a massive cached XML file on disk.
is working on a reply...