Hi Arno,
until this issue is addressed in the gutenberg-code, I made a quick & dirty workaround with JavaScript that works fine for me:
It modifies the href attributes for the links and sets the data-widht and data-height attributes to “0”. It has to be placed in the footer or at least after the gutenberg gallery html markup:
<!-- modify gutenberg gallery block to display the images in full-size by Thomas Zwick -->
<script type="text/javascript">
var galleryLinks = document.querySelectorAll('.blocks-gallery-item > figure > a');
for (var i = 0; i < galleryLinks.length; i++) {
var pos = galleryLinks[i].href.lastIndexOf("-"); // get the position of the last "-"
var posFileExtension = galleryLinks[i].href.lastIndexOf("."); // get the position of the last "."
var fileExtension = galleryLinks[i].href.slice(posFileExtension); // extract file-extension from href
galleryLinks[i].href = galleryLinks[i].href.substring(0, pos) + fileExtension; // set the new href attribute to full size
galleryLinks[i].setAttribute("data-width", "0"); // set data-width to "0"
galleryLinks[i].setAttribute("data-height", "0"); //set data-height to "0"
}
</script>
<!-- end modify gutenberg gallery block -->
I had to disable the function to close the overlay by scrolling in the plugin settings because there were javascript errors with the “0” data-width & data-height attributes.
-
This reply was modified 5 years, 8 months ago by tzwick.
-
This reply was modified 5 years, 8 months ago by tzwick.
-
This reply was modified 5 years, 8 months ago by tzwick.