Slideshow on pages

Hi, I'm working on a theme and I need some help.

I have 6 pages and 6 albums. What I want to do is, for example, on my page "Football" I want a slideshow that shows random images of the "Football" album.

I thought on something like:
`


<?php getCodeblock(); ?>

<?php printPageContent();?>


`
and then add a function with the album as argument on the codeblock of each page to show the slideshow.

Can someone help me and tell me how to get this done exactly? thanks

Comments

  • acrylian Administrator, Developer
    If these albums are toplevel albums the easiest is to tie the page titlelink and the album name together (so page "football" and an album "football"). We do generate the download link based on the related release article that simple way.

    You can call our slideshow (jquery cycle mode) on any other page direclty by placing the function and passing an albumobject to it. It has also a parameter for shuffle/random order. See the documentation. If your want only a specific number of random images you have to built your own using the jquery cycle script.
  • canica Member
    So, got the slideshow on my pages now but there's another problem. Seems to be theme-related since I've tried the exact same code on another theme and it works great. My theme is a mod of the stopdesign theme.

    This is the code (I know it shows the same album on every page, it's just a test):
    `


    <?php $albumobject = new Album($_zp_gallery,"football"); ?>

    <?php printSlideShow(false, false, $albumobject, "", 900, 360, true, true); ?>

    <?php set_context(ZP_ZENPAGE_PAGE); ?>

    <?php printPageContent();?>

    `
    And this on the head: <?php printSlideShowJS() ?>

    In my theme the slideshow is displayed twice and it's just 2 static images. As I said, I've tried that code on another theme and the slideshow works perfectly.

    Also, how can I show the controls to go to the previous/next image manually?
  • acrylian Administrator, Developer
    if you are on an Zenpage page anyway there is no need for `?php set_context(ZP_ZENPAGE_PAGE); ?>
    `this at all.

    The controls are an option of the plugin. Those are global for all slideshows but you could override that with the function `setOption()`(please see doc for info and the plugin for the option name).

    Beside that you can always built your own complete custom slideshow manually using all the jQuery Cycle plugin provides: http://http//www.malsup.com/jquery/cycle/
  • canica Member
    So no idea of why it doesnt work?

    I just realized I'm getting an error message on firebug: Uncaught TypeError: Object [object Object] has no method 'cycle'. That's because it's not loading the .js right?
  • acrylian Administrator, Developer
    Yes, that is because the JS is not loaded. I have no idea why that would happen. Any other errors?

    Alternatively just add the js manually to the page header:

    `/slideshow/jquery.cycle.all.js">`

    That's what we actually do on our own front page.
Sign In or Register to comment.