If you'd like to share an asset on an external website without downloading it from PhotoShelter and uploading it to another server, PhotoShelter offers two convenient features; embed codes and direct links. This article will guide you through these features and provide useful tips for optimizing your embeds.Â
Table of Contents:
- Create an Embed Code for an Image or Video
- Embedding the Asset
- Video Embed Options
- Create a Direct Link to any AssetÂ
- Embed & Direct Link Permissions
-
Embed & Direct Link Versions
Â
Â
Create an Embed Code for an Image or Video
Â
- Select an image or video file and open the Embed & Link accordion in the right pane.
- Under Embed Code, click Get Embed Code.
- For videos, choose a Format and Type (see Video Embed Options below).
- Click Copy Code.
- Once a code is generated, it is static and can be copied by anyone with Library access.
- To turn off an embed, use the Embeds enabled toggle in the Embed & Link accordion.
Embedding the Asset
Â
The HTML code includes a link to a webpage where the asset is hosted and viewable contained inside an iFrame (videos can also use a JavaScript embed).
After you've generated the Embed code, you can paste the code into the HTML editor on your external website.Â
Â
Video Embed Options
After you click Get Embed Code on a video, choose a Format and a Type before copying the code.
Format
- Responsive: The video resizes to fit the page or browser window. Best for most websites, including sites viewed on phones and tablets.
- Fixed size: The video displays at a set height and width. Use this when the video needs exact dimensions, such as in a sidebar.
Type
- Javascript (recommended): The default choice for most websites.
- iFrame: Use this if your website platform does not allow scripts.
Â
Resizing Image Embeds
Image embeds use an iFrame. Our iFrame makes a best-guess estimate of the image size based on its aspect ratio and orientation, so some embeds may show a gray border. To adjust the fit, change the width and height dimensions of the iFrame inside the copied embed code:
We recommend adjusting these dimensions in increments of 50px until you reach your desired fit.Â
Â
Create a Direct Link to any Asset
In addition to image or video embeds, you can create a direct link to any original asset in your account:
- Select any asset and open the Embed & Link accordion in the right pane
- If an asset has not previously been linked, click Get Direct Link to generate the link, then click Copy Link
- Once a link is generated, it is static and can be copied by anyone with Library access.Â
- You can also revoke the direct link for an asset using the trash icon
Â
Embed & Direct Link Permissions
Embed Codes and Direct Links are entirely separate from how assets are shared on your portal. As such, embeds and direct links will be visible to anyone with access to the website (or document) where they are used regardless of the sharing settings for the gallery the asset lives in.
However, you can still control the accessibility of an asset in an embed by enabling or disabling the embed (or by revoking a direct link). Inside the "Embed Code" accordion, for any asset that has had its embed code generated, there is an Embeds enabled toggle to enable or disable the embed. When this toggle is on, then the asset will be viewable anywhere it is embedded. When this toggle is off, then, regardless of where the asset is enabled, it will no longer be visible. Images will display the standard "Missing Asset" image for PhotoShelter and videos will display a black screen with a message indicating that the asset is not able to be viewed via an embed at this time.
Note: If an asset is embedded somewhere and is enabled, should that asset be moved into the Trash inside your PhotoShelter library, it will automatically disabled the embed.
Note: Images may often be cached in your browser's local memory, so disabling an image might cause the image to disappear right away if you already have the webpage its embedded on open. Clearing your browser cache will immediately solve this.
Â
Embed & Direct Link Versions
Images in PhotoShelter are able to be related to earlier and later versions of themselves using the Image File Versioning feature. Embeds and Direct Links of images respect this feature, so that you never have to update an embedded image's code in your website if you update the version of the asset in PhotoShelter.
As soon as you add a new version to an image or activate an older version, you'll first see this warning modal alerting you to the potential impact of this action on external instances of the asset.Â
If you accept this modal and activate a new version of an asset, then your image will automatically update to the active version in any locations where it is embedded.
Note: Images may often be cached in your browser's local memory, so disabling an image might cause the image to disappear right away if you already have the webpage its embedded on open. Clearing your browser cache will immediately solve this.