limit number of thumbnails shown

Permalink Browser Info Environment
Hi,

is there a way of having only a limited number of thumbnails showing up on the page?
Say there are twenty pics in one file set but I only want ten thumbnails to show on page. Then when I open the lightbox be able to click through all of the pics in the set.

I sorted through all the q & a here, sorry if I overlooked the answer if it is already there.
THXS!

Type: Discussion
Status: In Progress
rritz
View Replies:
jordanlev replied on at Permalink Reply
jordanlev
You can achieve this with a little bit of jquery code in the block template. Edit the following file on your server:
packages/sortable_fancybox_gallery/blocks/sortable_fancybox_gallery/view.php

...and at the very bottom (BELOW the "<?php endif; ?>" line), add this new code:
<script type="text/javascript">
$(document).ready(function() {
  var show_number_of_thumbnails = 10;
  $('.sortable_fancybox_gallery_image:gt(' + (show_number_of_thumbnails - 1) + ')').hide();
});
</script>


Hope that helps!

-Jordan
rritz replied on at Permalink Reply
rritz
Perfect. Thxs a lot!!
dkjain replied on at Permalink Reply
dkjain
Hi Jordan,

I wanted same thing as original OP but with "Deluxe Image Gallery" which I suppose is an enhanced version of Sortable Fancybox gallery.

So I modified the class name as per Deluxe Image Gallery class names in your code but that did not yield the desired results.
<script type="text/javascript">
$(document).ready(function() {
  var show_number_of_thumbnails = 1;
  $('.deluxe_image_gallery_image:gt(' + (show_number_of_thumbnails - 1) + ')').hide();
});
</script>

Could you help make this work for "Deluxe Image Gallery" too. I suppose the problem is with the gt() function of the jquery selector

thanks
dkj
dkjain replied on at Permalink Reply
dkjain
BTW where is the gt() function defined ? Is that a concrete5 helper function ?
dkjain replied on at Permalink Reply
dkjain
Ok :gt() is a jquery selector. Ok but the entire code is never loaded if you place it below endif

<script type="text/javascript">
$(document).ready(function() {
  var show_number_of_thumbnails = 1;
  $('.deluxe_image_gallery_image:gt(' + (show_number_of_thumbnails - 1) + ')').hide();
});
</script>


thanks
dkj
dkjain replied on at Permalink Reply
dkjain
Hi

If I have more than one gallery on the page, it will only display first gallery images upto specified no of limited image rest gallery are hidden by the jquery selector.

Could you modify the code so that it only hides images for that each gallery.

thanks
dkj
jordanlev replied on at Permalink Reply
jordanlev
Please provide a link to the page on your site where you have the gallery and I can take a look.
dkjain replied on at Permalink Reply
dkjain
here is the link
http://ananyalifeskills.com/gallery/summer-camp/
dkjain replied on at Permalink Reply
dkjain
Here is another one.

http://ananyalifeskills.com/press/

The problem I am facing is when there are more than two galleries on the same page then only the first image from the first gallery is shown and other galleries get hidden. How can we display first image from each gallery on the same page.

thanks
dkj
jordanlev replied on at Permalink Reply
jordanlev
Try this jquery instead:
<script>
$(document).ready(function() {
  var show_number_of_thumbnails = 1;
  $('.deluxe_image_gallery_container').each(function() {
    $(this).children('.deluxe_image_gallery_image').slice(show_number_of_thumbnails).hide();
  });
});
</script>

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.