cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more here.

Discuss Dropbox Developer & API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can't get embedder to work

Can't get embedder to work

bramroos
New member | Level 2

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
3 Replies 3

Greg-DB
Dropbox 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
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
Dropbox 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.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    bramroos New member | Level 2
What do Dropbox user levels mean?