Forum Discussion

bramroos's avatar
bramroos
New member | Level 2
3 years ago

Can't get embedder to work

Hi,

 

I'm trying to get the embedder to work. I'm able to display a single file through the anchor tag but I would like to use the embedder. Could not find the answer on this forum unfortunately. The following is not working for me. Is there something I'm missing?

Working on localhost and Wordpress development.

 

 

<script type="text/javascript" src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs" data-app-key="appkey"></script>
<script type="text/javascript">
	var options = {
	// Shared link to Dropbox file
	link: "https://www.dropbox.com/sh/tcvwr7atlybzb2f/AAArhYK6_____n8P-SDeRRzZa?dl=0",
	file: {
		// Sets the zoom mode for embedded files. Defaults to 'best'.
		zoom: "best" // or "fit"
	},
	folder: {
		// Sets the view mode for embedded folders. Defaults to 'list'.
		view: "list", // or "grid"
		headerSize: "normal" // or "small"
	}
	}
	Dropbox.embed(options, element);

</script>

 

 

Hoping for some clues.
 
Many thanks,
Bram
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    Can you elaborate on what you mean when you say it is "not working"? For example, what error or unexpected output or result do you get? Make sure you check the JavaScript console for any errors, for instance.

     

    Looking at the code you shared here, I don't see where "element" is defined. Do you have that defined? That needs to the be element on your page where you want to put the Embedder.

     

    For example, if you have an element on your page like this:

    <div id="embedder_container"></div>

     

    Then you might define 'element' like this:

    var element = document.getElementById("embedder_container");

     

    • bramroos's avatar
      bramroos
      New member | Level 2

      Thanks for your quick response! 

       

      Got it to work. There was a typo in my js 😉

       

      Just a few other questions.

      Are there any other parameters for removing full screen etc?

      Is it possible to have the embedder not in an iframe?

      Lastly, is there a way to disable the dropbox logo or label it with another logo?

       

      Many thanks,

      Bram

      • Greg-DB's avatar
        Greg-DB
        Icon for Dropbox Staff rankDropbox Staff

        Thanks for following up. I'm glad to hear you got this working.

         

        And no, there aren't options for making customizations like those. All of the available options are listed in the documentation here.

About Discuss Dropbox Developer & API

Node avatar for Discuss Dropbox Developer & API
Make connections with other developers807 PostsLatest Activity: 2 days ago
218 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!