cajames / kirby-editor-gallery-block

A gallery block for the Kirby Editor
MIT License
61 stars 5 forks source link

Lightboxlink / Link image #19

Closed LordCanis closed 4 years ago

LordCanis commented 4 years ago

Hey,

great plugin - love it :-) Is it possible to link the image - maybe a lightboxlink?

In the gallery.php i try:

  <div class="k-editor-gallery-image-wrapper" style="<?= $imageStyle ?>">             
    <a href="<?= $image['image']->url()?>" data-fancybox="gallery">
      <img class="k-editor-gallery-image <?= $image['imageClass'] ?>" srcset="<?= $image['image']->srcset([500, 1000, 1500]) ?>" sizes="(max-width: 640px) 500px, (max-width: 1200px) 1000px, 1500px" itemprop="thumbnail" alt="<?= $image['altText'] ?>" />
    </a>
  </div>

Thx for help.

cajames commented 4 years ago

Hey @LordCanis! Yep sure you can. Actually that's how I do it on my website, using PhotoSwipe. If it helps I might add an example of how to do it. 👍

LordCanis commented 4 years ago

Hey @cajames! I think an example woukd be great. I tried in vain to link the pictures. Where and how do I have to insert the link? My example above is the /site/plugins/kirby-editor-gallery-block/snippets/gallery.php

Thx so much for your help!

LordCanis commented 4 years ago

After communicating with @medienbaecker it works. The code is correct and the Facybox works too.