Copied to clipboard

Flag this post as spam?

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


  • Martin Rud 103 posts 295 karma points
    Jun 23, 2020 @ 21:09
    Martin Rud
    0

    Automatic node name from properties when creating

    Hi forum,

    I have an event document type under which I add time span document type nodes. Like this

    • Events overview
      • Event x
        • 2020-06-23 to 2020-06-25
        • 2020-07-08 to 2020-07-10

    This example shows an event that happens twice.

    On the time span document type I have two properties, startTime and endTime. When editors create these nodes it is a pain that the must find a proper node name for them since the most meaningful name is "

    Can this be made programatically so the node name is filled out when the properties are set (that means before save og publish)?

  • Nik 1413 posts 6212 karma points MVP 3x c-trib
    Jun 23, 2020 @ 21:25
    Nik
    100

    Hey Martin,

    Not exactly... What you could do is set a random default when the node is first created and sent to the browser, then during the save event change the name based on the input data.

    To set the default name you could use this approach https://justnik.me/blog/how-to-add-default-values-to-properties-in-the-backoffice-for-umbraco-v8,

    Then hook into the saving event to set the real name, in order to bypass the validation checks.

    Nik

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies