Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • jc 3 posts 33 karma points
    Aug 06, 2024 @ 07:00
    jc
    0

    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.

  • Nik 1614 posts 7260 karma points MVP 7x c-trib
    Aug 06, 2024 @ 07:52
    Nik
    0

    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

  • jc 3 posts 33 karma points
    Aug 06, 2024 @ 08:17
    jc
    0

    Hi Nik,

    Thank you for your response. Do you have a documentation for Saved Notification and Contentment package?

  • Nik 1614 posts 7260 karma points MVP 7x c-trib
    Aug 06, 2024 @ 08:45
    Nik
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft