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 232 posts 902 karma points c-trib
    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 1593 posts 7151 karma points MVP 6x 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

Please Sign in or register to post replies

Write your reply to:

Draft