Apply to child folders/files what has been applied in its parent folder doctype
In the Content Tab, I have a parent folder with a doc type that has a toggle button, under it I have a child folder/files with a doc time that has a toggle button as well. Is there any documentation wherein if I toggle the button in the parent folder all the toggle button in its child files will be toggled as well.
There wouldn't be any specific documentation to do something like this to be honest.
However, if you need this functionality, what I would look at doing is hooking into the Saved Notification. Once the parent node has saved, you could then check to see if the toggle was enabled and if it was retrieve all children and update the toggle on them.
The biggest question, however, would be how do you limit the behaviour to just children as this approach would cascade down to the descendants as each Saved notifcation would repeat the processes down the tree.
I guess my biggest question is why do you need this? Would a better option be to use a dropdown/enum picker (from Contentment a package for Umbraco), that has a "Inherit from parent" as the default value, then "On", or "Off" (Or what ever the options need to be called?
Then you could handle the processing of the toggle/selector in the rendering rather than needing to cascade a save trigger down to the children?
This section of the Umbraco Docs talks about Notifictions - https://docs.umbraco.com/umbraco-cms/reference/notifications . The Saving/Saved notifications are part of the Content Service but it would be worth having a read over most of the docs in this section to help your understanding.
Apply to child folders/files what has been applied in its parent folder doctype
In the Content Tab, I have a parent folder with a doc type that has a toggle button, under it I have a child folder/files with a doc time that has a toggle button as well. Is there any documentation wherein if I toggle the button in the parent folder all the toggle button in its child files will be toggled as well.
Hi JC,
There wouldn't be any specific documentation to do something like this to be honest.
However, if you need this functionality, what I would look at doing is hooking into the Saved Notification. Once the parent node has saved, you could then check to see if the toggle was enabled and if it was retrieve all children and update the toggle on them.
The biggest question, however, would be how do you limit the behaviour to just children as this approach would cascade down to the descendants as each Saved notifcation would repeat the processes down the tree.
I guess my biggest question is why do you need this? Would a better option be to use a dropdown/enum picker (from Contentment a package for Umbraco), that has a "Inherit from parent" as the default value, then "On", or "Off" (Or what ever the options need to be called?
Then you could handle the processing of the toggle/selector in the rendering rather than needing to cascade a save trigger down to the children?
Nik
Hi Nik,
Thank you for your response. Do you have a documentation for Saved Notification and Contentment package?
Hi JC,
You can find details on Contentment here: https://github.com/leekelleher/umbraco-contentment
This section of the Umbraco Docs talks about Notifictions - https://docs.umbraco.com/umbraco-cms/reference/notifications . The Saving/Saved notifications are part of the Content Service but it would be worth having a read over most of the docs in this section to help your understanding.
Thanks
Nik
is working on a reply...