Getting 4 images?

Hi,

I am trying to get 4 images (2 Prev and 2 next) around the currently displayed image on image page. I am trying the Prev and Next functions but get only the first prev and first next.

Is there a way I can get 4 or a more number which can be specified as an argument?
I plan to show them as thumbnail on the image page. It is also ok if some random 4 images can be displayed from the current album.

..Sarthak

Comments

  • acrylian Administrator, Developer
    The prev/next does only workwith one prev and one next images. If you want more prev or next images you will have to code that yourself using the object model (see the user guide).

    You can also use the paged_thumbs_Nav or the jCarousel thumb nav plugins. Those display thumbs from the album, you may have to add the plugin functions to your theme.
  • Thanks acrylian. I am trying to add the function in image.php as <?php printjCarousel()?> and running into a fatal error.

    Any help would be appreciated.
  • acrylian Administrator, Developer
    You probably should enable the plugin that function belongs to.
  • I checked in the plugins tab and the v1.3.0 of this plugin is checked.
  • acrylian Administrator, Developer
    You did not look at hte documentation, did you? The function is wrong. Please note we don't have every single one in our head, too..
  • Apologies for the confusion.
    The plugin in admin panel was reporting wrong url. I found it at http://www.zenphoto.org/documentation/plugins/_zp-extensions---jcarousel_thumb_nav.php.html

    where it mentions "Place printjCarousel() on your theme's image.php where you want it to appear."

    I am still confused on how to proceed further.
  • acrylian Administrator, Developer
    Sorry for the indeed wrong doc... But right below the correct and only function is documentated in detail. Also the Zenpage theme provides an example.
  • Use this should be fine:
    <?php printjCarouselThumbNav(); ?>
  • Thanks ranmajen. It worked!
  • I am trying to implement the jCarousel plugin as well. I've added ranmajen's code to image.php, but I don't see anything.

    When I look at the rendered page source, there's a lot of jCarousel-related Javascript, defining the mycarousel_itemList variable and a couple of functions. After the Javascript, I see this:

    '<ul id="mycarousel">
    <!-- The content will be dynamically loaded in here -->
    '

    But nothing is displayed on the page.

    I put the jcarousel.css file, and the 3 graphic files, into the theme folder, as directed. I can see in the rendered page source that there are links to jquery.jcarousel.pack.js and jquery.jcarousel.css in their existing location (in zp-core/zp-extensions/jcarousel_thumb_nav/), so I assume I don't have to move those, or any other files, to the theme folder, right?

    Any help appreciated.
  • I guess the first thing you should try is to activate the zenpage theme and see if the `printjCarouselThumbNav()` works for it. That and check to see if your browser is reporting any javascript errors.
  • Thanks for the suggestions. The error console helped me solve the problem.

    It showed an issue in the Javascript that preloads thumbnails, titles, and links for the jCarousel plugin. I looked at the indicated line in the page source, and noticed that it was referencing an image whose title contained double quote marks.

    I guess that this must have been breaking the Javascript, because the error said that this line was missing a closing curly bracket. I changed the image's title to use single quotes instead... and now jCarousel works fine.

    The interesting thing is that the problem was occurring on any page I viewed, not just the one with the double quotes in the image title. Because the Javascript was preloading titles for all the images in the album, it was encountering this problem every time it ran.

    Maybe there is a way to make the jCarousel plugin detect and deal with double quotes... my Javascript skills are not that great, so I don't know if I want to try to tackle this. :) But for now, I'll just avoid double quotes in image titles.
  • acrylian Administrator, Developer
    We will take a look at escaping those quotes.
Sign In or Register to comment.