I've started using properties recursively a lot recently and it's really useful (both with the Macro syntax and in XSLT - see links at end in case anyone gets here through a google search looking for more info on recursion in Umbraco).
What is a pain though is having to click up through a tree to find out what is set where.
I know this could be done as a page with XSLT, etc. but could a button be added which would show you the values of properties if they were to be used recursively and also the name of the node where the property is set?
Maybe an example would better illustrate why this would be useful. If this was your scenario:
Node 1 (Value: 1)
- Node 2 (Value: blank)
- - Node 3 (Value: 0, set by accident or by an unexperienced user)
- - - Node 4 (Value: blank)
- - - - Node 5 (Value: blank)
And you wanted to know why the property value at node 5 was 0, currently you would have to click into each node, onto the relevant tab and check what is set at each level. If there was a button that you could click that gave the information:
" Value set as '0' at 'Node 3' "
Then this would make debugging site content much quicker!
Seems like this would be a neat little addition to my XML Dump package - shouldn't be too hard to implement... will try to squeeze it into next version.
Thanks @Jonas - I guess that would be one way to do it. You wouldn't want that information on a live site though. Maybe you could put it in an altTemplate but I still think it would be better to see at a glance in the Umbraco back end. I definitely agree the post should be in the wiki though.
Perhaps if a property was empty there could be a message below: "If used recursively value would be x set at node y". Or a button that would display an alert / popup with the information.
Edward, yes, I meant only during debugging. If you want to do invisible live debugging, another easy trick is to use xsl comment to get the data inside <!-- -->.
Recursive Properties
I've started using properties recursively a lot recently and it's really useful (both with the Macro syntax and in XSLT - see links at end in case anyone gets here through a google search looking for more info on recursion in Umbraco).
What is a pain though is having to click up through a tree to find out what is set where.
I know this could be done as a page with XSLT, etc. but could a button be added which would show you the values of properties if they were to be used recursively and also the name of the node where the property is set?
Maybe an example would better illustrate why this would be useful. If this was your scenario:
Node 1 (Value: 1)
- Node 2 (Value: blank)
- - Node 3 (Value: 0, set by accident or by an unexperienced user)
- - - Node 4 (Value: blank)
- - - - Node 5 (Value: blank)
And you wanted to know why the property value at node 5 was 0, currently you would have to click into each node, onto the relevant tab and check what is set at each level. If there was a button that you could click that gave the information:
" Value set as '0' at 'Node 3' "
Then this would make debugging site content much quicker!
Links:
http://umbraco.org/documentation/books/macro-parameters-syntax/advanced-parameter-syntax
http://forum.umbraco.org/yaf_postst2751_XSLT-Tip--Display-a-field-recursively.aspx
Hi Edward,
Seems like this would be a neat little addition to my XML Dump package - shouldn't be too hard to implement... will try to squeeze it into next version.
/Chriztian
Hi!
You could easily add another row with some info about the node where the value was found.
Btw, that recursive syntax is very useful, the whole Neehouse forum post should be in the wiki.
Regards
Jonas
Thanks @Jonas - I guess that would be one way to do it. You wouldn't want that information on a live site though. Maybe you could put it in an altTemplate but I still think it would be better to see at a glance in the Umbraco back end. I definitely agree the post should be in the wiki though.
Perhaps if a property was empty there could be a message below: "If used recursively value would be x set at node y". Or a button that would display an alert / popup with the information.
@Chriztian - I'll take a look! Thanks.
Edward, yes, I meant only during debugging. If you want to do invisible live debugging, another easy trick is to use xsl comment to get the data inside <!-- -->.
is working on a reply...