Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • kehzen Friend
    #663020

    1. Strange thing about Gallery is, need to insert at least 2 image in order for the image to enlarge when click. Else it will provide link to Gallery item in article.

    2. The click and enlarge image is broken.

    Pankaj Sharma Moderator
    #663122

    Hi
    try this

    Open templates/ja_charity/html/layouts/joomla/content/image/gallery.php file
    find and copy js script

    and insert it after line 114

    <script type="text/javascript">
    (function ($) {
    $(document).ready(function(){
    $('#<?php echo $galleryId; ?>').on('click', function (event) {
    event.preventDefault();
    blueimp.Gallery(<?php echo json_encode($images); ?>, {
    transitionSpeed: 0,
    hidePageScrollbars:false
    });
    });
    });
    })(jQuery);
    </script>

    Save and check ,
    Kindly take a backup of original file , before change .

    kehzen Friend
    #663125

    Hi,

    Inserted the javascript as told. Almost work but not quite.
    1. Image will only appear at All filter. But each time only 2 images when click next or previous.
    2. At own “The Production” Category, image still broken when click.

    Pankaj Sharma Moderator
    #663873

    Hi
    I sent this bug report to development team for further investigation and fix .
    It will take some time to investigate
    ,thanks in advance for your Patience in this case .

    Pankaj Sharma Moderator
    #746210

    Hi
    I sent this bug report to development team for further investigation and fix .
    It will take some time to investigate
    ,thanks in advance for your Patience in this case .

    kehzen Friend
    #664176

    In that case, for the time being how do I make the gallery unclickable? So it won’t call up the pop up with broken image.

    kehzen Friend
    #746216

    In that case, for the time being how do I make the gallery unclickable? So it won’t call up the pop up with broken image.

    Mo0nlight Moderator
    #664187

    Hello kehzen.

    You can try with my workaround as below to solve issue:

    Add the code at line : 40

    function blueGalleryImp(images) {
    blueimp.Gallery(images, {
    transitionSpeed: 0,
    hidePageScrollbars:false
    });
    }

    edit the code at line : 67-91

    [PHP]<?php
    $images = array();
    foreach($gallery[‘src’] as $index => $src) {
    $img = new stdClass();
    $img->href = JUri::root(true).’/’.$src;
    $img->title = $gallery[‘caption’][$index];
    $images[] = $img;
    }
    ?>
    <script type=”text/javascript”>
    var image<?php echo preg_replace(“/[^0-9]/”,””,$galleryId); ?> = <?php echo str_replace(“/s+/”,””,str_replace(“”,””,json_encode($images))); ?>;
    </script>
    <div id=”<?php echo $galleryId; ?>” onclick=”blueGalleryImp(image<?php echo preg_replace(“/[^0-9]/”,””,$galleryId); ?>);” class=”btn-fullscreen”>
    <span class=”fa fa-expand fa-2x” title=”<?php echo htmlspecialchars(JText::_(‘TPL_VIEW_FULL_SCREEN’)); ?>”></span>
    </div>[/PHP]

    edit the code at line : 95-126

    [PHP]<?php if(is_array($gallery) && count($gallery[‘src’]) > 1):
    $images = array();
    foreach($gallery[‘src’] as $index => $src) {
    $img = new stdClass();
    $img->href = JUri::root(true).’/’.$src;
    $img->title = $gallery[‘caption’][$index];
    $images[] = $img;
    }
    ?>
    <script type=”text/javascript”>
    var image<?php echo preg_replace(“/[^0-9]/”,””,$galleryId); ?> = <?php echo str_replace(“/s+/”,””,str_replace(“”,””,json_encode($images))); ?>;
    </script>
    <?php endif; ?>
    <div id=”<?php echo $galleryId; ?>” <?php if(is_array($gallery) && count($gallery[‘src’]) > 1): ?> onclick=”blueGalleryImp(image<?php echo preg_replace(“/[^0-9]/”,””,$galleryId); ?>);” <?php endif; ?> class=”item-image ja-gallery-list”>
    <?php if(is_array($gallery) && count($gallery[‘src’]) > 1): ?>
    <span class=”btn-play”>

    </span>
    <span class=”gallery-mask”></span>
    <?php endif; ?>
    <?php echo JLayoutHelper::render(‘joomla.content.image.image’, $data); ?>
    </div>[/PHP]

    If you’re not familiar with code, just download the attached file below and replace it into your site (always backup the old file first)

    And let me know how it goes.

    Have a nice day!!!

    BigHug Friend
    #746227

    Hello kehzen.

    You can try with my workaround as below to solve issue:

    Add the code at line : 40

    function blueGalleryImp(images) {
    blueimp.Gallery(images, {
    transitionSpeed: 0,
    hidePageScrollbars:false
    });
    }

    edit the code at line : 67-91

    <?php
    $images = array();
    foreach($gallery['src'] as $index => $src) {
    $img = new stdClass();
    $img->href = JUri::root(true).'/'.$src;
    $img->title = $gallery['caption'][$index];
    $images[] = $img;
    }
    ?>
    <script type="text/javascript">
    var image<?php echo preg_replace("/[^0-9]/","",$galleryId); ?> = <?php echo str_replace("/s+/","",str_replace("","",json_encode($images))); ?>;
    </script>
    <div id="<?php echo $galleryId; ?>" onclick="blueGalleryImp(image<?php echo preg_replace("/[^0-9]/","",$galleryId); ?>);" class="btn-fullscreen">
    <span class="fa fa-expand fa-2x" title="<?php echo htmlspecialchars(JText::_('TPL_VIEW_FULL_SCREEN')); ?>"></span>
    </div>

    edit the code at line : 95-126

    <?php if(is_array($gallery) && count($gallery['src']) > 1):
    $images = array();
    foreach($gallery['src'] as $index => $src) {
    $img = new stdClass();
    $img->href = JUri::root(true).'/'.$src;
    $img->title = $gallery['caption'][$index];
    $images[] = $img;
    }
    ?>
    <script type="text/javascript">
    var image<?php echo preg_replace("/[^0-9]/","",$galleryId); ?> = <?php echo str_replace("/s+/","",str_replace("","",json_encode($images))); ?>;
    </script>
    <?php endif; ?>
    <div id="<?php echo $galleryId; ?>" <?php if(is_array($gallery) && count($gallery['src']) > 1): ?> onclick="blueGalleryImp(image<?php echo preg_replace("/[^0-9]/","",$galleryId); ?>);" <?php endif; ?> class="item-image ja-gallery-list">
    <?php if(is_array($gallery) && count($gallery['src']) > 1): ?>
    <span class="btn-play">

    </span>
    <span class="gallery-mask"></span>
    <?php endif; ?>
    <?php echo JLayoutHelper::render('joomla.content.image.image', $data); ?>
    </div>

    If you’re not familiar with code, just download the attached file below and replace it into your site (always backup the old file first)

    And let me know how it goes.

    Have a nice day!!!

    kehzen Friend
    #746355

    Hi Mo0nlight,

    You are right, I’m not familiar with php.
    Uploaded your gallery.php. It worked on own category now. However, When scrolling images, it only can scroll 2 images even though I have 8 images.

    Mo0nlight Moderator
    #664873

    Hi kehzen.

    Well. the function is working fine right now.

    Because every block image is one article of your website. When you click on one block, it will show the popup of all images inside the article.

    And I also check you administrator, every article has only 2 images.

    Maybe that’s what you wonder?

    Let me know if you still have concern about this.

    Mo0nlight Moderator
    #746375

    Hi kehzen.

    Well. the function is working fine right now.

    Because every block image is one article of your website. When you click on one block, it will show the popup of all images inside the article.

    And I also check you administrator, every article has only 2 images.

    Maybe that’s what you wonder?

    Let me know if you still have concern about this.

    kehzen Friend
    #665109

    Dear Mo0nlight,

    I see, I got it now. I thought it supposes to browse through all the images from articles under the same category.

    Thanks.

    kehzen Friend
    #746500

    Dear Mo0nlight,

    I see, I got it now. I thought it supposes to browse through all the images from articles under the same category.

    Thanks.

Viewing 14 posts - 1 through 14 (of 14 total)

This topic contains 14 replies, has 4 voices, and was last updated by  kehzen 9 years, 3 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum