fanningert / kirbycms-extension-image

KirbyCMS Extension - Image Extended
http://www.fanninger.at/thomas/works/kirbycms-extension-image
GNU General Public License v3.0
28 stars 2 forks source link

Support for zooming javascripts #5

Closed fanningert closed 9 years ago

fanningert commented 9 years ago

Possible feature to add rel and class to the hyperlink tag (<a>).

Tags:

c::set('kirby.extension.imageext.js_zoom.gallery_attr', 'rel');
c::set('kirby.extension.imageext.js_zoom.gallery_prefix', 'gallery');
c::set('kirby.extension.imageext.js_zoom.class', 'fancybox');

Example:

(imagext: picture.jpg gallery: 1)

Result:

<a href="..." rel="gallery1" class="fancybox">
  <img src="..." />
</a>
xypaul commented 9 years ago

That'd be a great feature to have :+1:

fanningert commented 9 years ago

changed the logic in the concept phase a little.

Tags:

c::set('kirby.extension.imageext.js_zoom.gallery_attr', 'rel');
c::set('kirby.extension.imageext.js_zoom.gallery_prefix', 'gallery');
c::set('kirby.extension.imageext.js_zoom.class', 'fancybox');

Example:

(imageext_gallery gallery: 1)
  (image: picture.jpg)
  (imageext: picture.jpg)
(/imageext_gallery)

Result:

<div class="image-gallery">
  <a href="..." rel="gallery1" class="fancybox">
    <img src="..." />
  </a>
  <a href="..." rel="gallery1" class="fancybox">
    <img src="..." />
  </a>
</div>
fanningert commented 9 years ago

Javascript library support is included in version 0.9. Simple gallery support (image_gallery: image1.jpg,image2.jpg) will come in next version.

In this version you can define the image parameter at the gallery tag, but you can also overwrite this parameter on image level.

Example for usage:

(image_gallery mode: crop width: 200 height: 200 caption: true gallery: 1)
  (image: dsc00439.jpg)
  (image: dsc00439.png)
(/image_gallery)

Result

<div class="image-gallery">
  <figure class="image-figure figcaption-bottom">
    <a href="https://.../content/2-works/1-kirbycms-extension-image/dsc00439.jpg" class="image-link fancybox" rel="gallery-1">
      <img src="https://.../thumbs/dsc00439-7f1f024208a96a4e98acba227858efa4.jpg" class="image">
    </a>
  </figure>
  <figure class="image-figure figcaption-bottom">
    <a href="https://.../content/2-works/1-kirbycms-extension-image/dsc00439.png" class="image-link fancybox" rel="gallery-1">
      <img src="https://.../thumbs/dsc00439-987d92a50297cc6807c4f897145c9c00.png" class="image">
    </a>
  </figure>
</div>

Following config parameter are supported kirby.extension.imageext.gallery.class => Default: image-gallery kirby.extension.imageext.gallery.prefix => Default: gallery- kirby.extension.imageext.gallery.link.class => Default: fancybox kirby.extension.imageext.gallery.link.attr => Default: rel

fanningert commented 9 years ago

Is now working