Copied to clipboard

Flag this post as spam?

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


  • Matt 91 posts 237 karma points
    Jun 03, 2015 @ 13:09
    Matt
    0

    Populate node name from node property

    A site we are developing has nodes associated with members. There is a member picker on the node to associate it.

    The client has asked if it is possible to automatically populate the node name with the picked member's value.

    I've had a look at using the Content events, however the node name required validation is preventing even getting to this event.

    Is this something I would need to edit the angularjs to populate the nodename?

    Any ideas greatly appreciated!

  • Matt 91 posts 237 karma points
    Jun 15, 2015 @ 12:37
    Matt
    0

    Still been researching this and haven't found a solution...would anyone have any ideas?

    Need to be able to automatically fill in the Node Name based on a property value entered on the node.

    So for example a new node is created, and a value of "Company A" is picked in the dropdown. The Nodename is then automatically filled in with "Company A"

  • Maff 141 posts 465 karma points
    Jun 15, 2015 @ 13:55
    Maff
    0

    Hi,

    What Content events have you tried to override so far? Maybe the 'saving' rather than the 'saved' event could work for you? (not sure at what point the property validation kicks in though).

    Failing that you could create a custom Property Editor that extends the Member Picker data type and adds the member name to your node name when it's selected. However that would be a bit more work...

    Thanks,

    Maff

  • Matt 91 posts 237 karma points
    Jun 15, 2015 @ 14:44
    Matt
    0

    Thanks for the reply - I have tried Saving and Saved. It appears the node name validation occurs before any server side events (front end validation?).

    The closest I have got is using Javascript click events/on change events to populate the nodename on the field change, but this isn't really ideal.

  • David Brendel 792 posts 2970 karma points MVP 3x c-trib
    Jun 15, 2015 @ 14:25
    David Brendel
    0

    Hi Matt,

    if you really want to do it when you select the member then you have to create a custom property editor in which you handle the callback of the member Dialog and update the property of the node you are editing.

    Don't know for sure how you geht access to the node property but with some testing you should Figuren it out. Maybe it is in scope or in some parent scope.

    Shouldn't this mich afford. The Dialogs are fairly simple to use. Here is the API doc if you don't know it already.

    http://umbraco.github.io/Belle/#/api

    Regards David

  • Rune Antonsen 29 posts 145 karma points
    Feb 01, 2017 @ 10:18
    Rune Antonsen
    2

    A bit old thread, but just wanted to say how I ended up solving this, if anyone maybe finds it helpful.

    I ended up using editorState: http://umbraco.github.io/Belle/#/api/umbraco.services.editorState

    var currentEditorState = editorState.getCurrent();
    currentEditorState.name = "New awesome name";
    editorState.set(currentEditorState);
    

    My use case was that I needed the node name to match the selection from a dropdown selector.

  • Ronen Rimon 22 posts 124 karma points
    Mar 04, 2019 @ 15:39
    Ronen Rimon
    0

    Thank you, it was very helpful

Please Sign in or register to post replies

Write your reply to:

Draft