Level up your Box knowledge with brand new learning paths on Box University. Visit training.box.com to get started

Content Picker questions

Answered
New post

Comments

6 comments

  • Priyajeet

    1. That is something you will have to implement yourself. You can do something like

    window.open('https://codepen.io/box-platform/live/PWPxBm', 'sdfsdf', "width=800,height=600')

    However you will have to also write some code to pass data from the modal to the parent window via postMessage (https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage) or window.opener (https://developer.mozilla.org/en-US/docs/Web/API/Window/opener) or some other mechanism, so that what the content picker chooses, gets sent back to your code that opened the popup.

     

    2. Use ContentPicker parent class instead of FolderPicker or FilePicker. It accepts a type option which can be 'file,folder,web_link'

    var contentPicker = new Box.ContentPicker();
    contentPicker.show(folderId, accessToken, { type: 'file,folder,web_link' });

     

    0
    Comment actions Permalink
  • jamiegaskin

    Thank you so much, that's really helpful. Is there anywhere that describes the ContentPicker class a bit more?

    0
    Comment actions Permalink
  • Howard

    Hi  and 

     

    Have you checked out this article here?

    https://developer.box.com/v2.0/docs/box-content-picker

    0
    Comment actions Permalink
  • jamiegaskin

    Hi Howard,

    Thanks for the response!

    Yes, I've read through there. All the examples are split into file/folder so it's a little unclear what's part of the Content picker parent class and what's individual to files/folders.

     

    Best,

    Jamie

    0
    Comment actions Permalink
  • Priyajeet

    FilePicker is the same as ContentPicker with type='file' hardcoded.

    FolderPicker is the same as ContentPicker with type='folder' hardcoded.

    And in ContentPicker you can just specify the type you want, comma separated list.

    I probably should add it to the documentation.

    0
    Comment actions Permalink
  • jamiegaskin

    Great, that's really helpful. Thanks!

    0
    Comment actions Permalink

Please sign in to leave a comment.