Forums

Meteor Slides
Tweaking Starting Slide Options (2 posts)

  1. Pudding4ever
    Member
    Posted 4 months ago #

    Hi! First off, thanks for making this awesome plugin. I went through more than a few sliders before I found one that would do most of what I wanted to do.

    I'm doing something a little unconventional for a slideshow viewer. I'm trying to create a comic website that uses slideshows to display the 'books', preserving a bit of the illusion that you're reading a book rather than loading a series of web pages.

    I have two questions, essentially.

    1. Is there a way to make the slideshow default to showing the 'last' slide to be added instead of the first? As far as I've read, the metadata will only let me pick a specific slide and will default to the first if I don't use metadata or enter a number higher than the number of slides in the slideshow. I would like it to default to the latest slide, to let me queue up new pages to be published later without having to manually change which one the viewer starts on on the 'latest comic' page.

    2. I could probably find this out by just trying to make a slideshow with that many slides, but as long as I'm asking the first question I'll ask this one. How well can Meteor-Slides handle a 72+ slide slideshow?

    http://wordpress.org/extend/plugins/meteor-slides/

  2. JLeuze
    Member
    Posted 3 months ago #

    You're welcome, I'm glad it has come in handy for you!

    That sounds like a fun project, there is a WordPress related web comic that uses a slideshow, but it's a strip with just a few slides in each episode: http://www.webboycomic.co.uk/comic/web-comic/go-akismet

    By default, the slides are going to be sorted by the publish date in reverse chronological order just like a blog, so the latest slide post will be first. You probably want this in regular chronological order so that you can publish page 1 first, page 2 second, etc so that when you publish the latest page, it is last and the slides can be read as a regular book, is that correct?

    To do this you would need to use a custom slideshow template, with just one simple update to the parameters for the slideshow query. You just need to take this array:

    $loop = new WP_Query( array(
    
    	'post_type'      => 'slide',
    	'slideshow'      => $slideshow,
    	'posts_per_page' => $options['slideshow_quantity']
    
    ) ); ?>

    And add a parameter for the order to switch it from descending to ascending:

    $loop = new WP_Query( array(
    
    	'post_type'      => 'slide',
    	'slideshow'      => $slideshow,
    	'order'          => 'ASC',
    	'posts_per_page' => $options['slideshow_quantity']
    
    ) ); ?>

    Now the oldest slide will be first and the newest last, so the slides just need to be published in the order you want them read in.

    Getting the slideshow to start on the latest slide dynamically is a little trickier. You need to customize the slideshow template a bit more. First you need to get the post count to get the number of slides in the loop and use that number in the metadata for the starting slide so that it will start on the last slide regardless of the number of slides.

    Try replacing lines 29-63 of the unedited slideshow template:

    <div id="meteor-slideshow<?php echo $slideshow; ?>" class="meteor-slides <?php
    
    	...
    
    	?>">

    With this edited version:

    <div id="meteor-slideshow<?php echo $slideshow; ?>" class="meteor-slides <?php echo $slideshow . ' ' . $meteornav . ' { ';
    
    	if ( !empty( $slideshow ) ) { echo "next: '#meteor-next" . $slideshow . "', prev: '#meteor-prev" . $slideshow . "', pager: '#meteor-buttons" . $slideshow . "', "; }
    
    	$latest_slide = $loop->post_count -1;
    
    	echo 'startingSlide:' . $latest_slide;
    
    	if ( !empty( $metadata ) ) { echo ', ' . $metadata; }	
    
    echo ' }'; ?>">

    That should get the slideshow setup how you want it, but 72 slides will be pushing it! Really depends on the size of the slides though, if they are a single panel with a lot of compression you might be fine, but if each slide is a fairly large page of a graphic novel, you might have some problems. The slideshow should still run, but if the slide images are each 200k, that would be nearly 15 megs, which would be a lot to load.

    You could try loading the images dynamically, jQuery Cycle should support that, but it would take some customizations. Your other option would be to break it up into chapters.

Reply

You must log in to post.

About this Plugin

About this Topic