Copied to clipboard

Flag this post as spam?

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


  • Tom 120 posts 448 karma points
    May 19, 2014 @ 10:36
    Tom
    0

    dialogService - define startnode

    Hey

    I'm trying to open a dialog that lists the children of a certain node. Heres some code:

        dialogService.contentPicker({
                            multiPicker: false,
                            startNode: {
                                id: 4217 //not working
    
                            },
                            callback: function (data) {
                                   //bla bla
                            }
        });
    

    How do i define the startnode?

    Or how do i just list all content of a certain type?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    May 19, 2014 @ 13:02
    Jan Skovgaard
    0

    Hi Tom

    Don't know if you could perhaps benefit from reading Kevin's blogpost here http://blog.imulus.com/kevin-giszewski/umbraco-7-property-editor-weighted-content-list

    In one of the code examples he is setting the startnode id like this: startNodeId:4217

    Hope this helps.

    /Jan

  • Tom 120 posts 448 karma points
    Jun 02, 2014 @ 14:00
    Tom
    0

    sadly, I couldn't get it to work.

    I guess I need to use dialogService.treePicker, but again the documentation is sparse and I have no idea where to start.

    So any inputs are welcome...

  • Tom 120 posts 448 karma points
    Jun 16, 2014 @ 10:58
    Tom
    100
    dialogService.treePicker({
          multiPicker: true,
          section: "content",
          treeAlias: "content",
          startNodeId: 6230,
          callback: //bla bla
    });
    

    works :)

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jun 20, 2014 @ 20:23
    Jan Skovgaard
    0

    Hi Tom

    Cool you got it working and thanks for sharing - So it seems that section and treeAlias should be defined? (Mandatory)

    /Jan

  • Rune Antonsen 29 posts 145 karma points
    Apr 24, 2017 @ 09:41
    Rune Antonsen
    0

    Update: I didn't manage to get the solution above to work.
    I'm currently running Umbraco 7.5.10

    I had to use customTreeParams

    dialogService.contentPicker({
        multiPicker: true,
        customTreeParams: "startNodeId=10185",
    });
    

    Additional: If you want to only allow certain document types to be selected you could just add
    filter: "docType1, docType2, docType3"

    And if you want to add a css class to the not allowed document types add:
    filterCssClass: "not-allowed not-published"
    (not-allowed and not-published is css classes used by Umbraco, it will display them as greyed out and with a cursor of not-allowed.)

Please Sign in or register to post replies

Write your reply to:

Draft