Copied to clipboard

Flag this post as spam?

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


  • Ben Dickman 21 posts 103 karma points
    Sep 24, 2021 @ 11:27
    Ben Dickman
    0

    Restrict editor service content picker to specific doc type

    Hi all,

    I have the following code which loads the content picker using the editor service, this is working apart from I am currently able to pick any item in the tree.

    I would like to be able to restrict this to a specific doc type. I know this is possible as I done this when using the multi node tree picker, I just can't seem to find the configuration option.

    my function that I call from my custom grid editor:

    $scope.showContentPickerDialog = function () {
    
                var options = {
                    multiPicker: true,
                    submit: function (value) {
                        $scope.model.selections = value.selection;
                        editorService.close();
                    },
                    close: function () {
                        editorService.close();
                    }
                }
    
                editorService.contentPicker(options);
            }
    

    Any ideas?

    Thanks in advance,

    Ben

  • Lucas Michaelsen 32 posts 233 karma points
    Sep 25, 2021 @ 12:16
    Lucas Michaelsen
    101

    Hey Ben, Heree is some options you are looking for :)

    var options = {
         multiPicker: true,
         submit: function() {},
         close: function() {},
         filter: 'doctypeAlias', // allows only that doctypee to be picked
         startNode: {
              id: -1, // Start node ide
              query: '', // xpath options
         }
    }
    
  • Ben Dickman 21 posts 103 karma points
    Sep 27, 2021 @ 10:25
    Ben Dickman
    0

    Hey Lucas,

    the 'filter' option did the job!

    thank you,

  • Josef Henryson 24 posts 98 karma points
    Feb 14, 2023 @ 08:28
Please Sign in or register to post replies

Write your reply to:

Draft