skip to Main Content

Was setting up a carousal,
but fancybox not loading gdrive image file link

<a data-fancybox="gallery1" href="https://drive.google.com/file/d/<file id>/view?usp=sharing"><a>

any idea why,
does fancybox have any access issues with drive files
thumbnails working though

tried gdrive preview links. still meh

2

Answers


  1. The link you are using doesn’t look correct.

    You seem to be using the link given by the "get link" drive function, which is not a link to the actual image and doesn’t work for embedding.

    You can get an embed element from drive.

    • Double click the image in your drive to preview it.
    • Click the three vertical dots at the top right
    • Select "Open in new window"
    • Cick the three vertical dots again
    • Select ‘Embed item’

    You also have to make sure the image is shared to the public.

    The link returned in the element comes out with this format:
    https://drive.google.com/file/d/FILE_ID/preview

    This is the recommended method for embedding according to this blogpost

    You could also get a file’s web content link via the Drive API but it’s more of a hastle.

    Login or Signup to reply.
  2. If you want to display your link inside the iframe, then follow the documentation and create links like this:

    <a href="iframe.html" data-fancybox data-type="iframe" data-preload="false">
      Click me
    </a>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search