How to control slideshow in G2

accleas

Joined: 2005-04-20
Posts: 25
Posted: Wed, 2005-04-20 07:57

I would like to know if there is a way to control how the user views the slideshow? For example, when the user clicks on the slideshow link it comes up with the transition set to RANDOM, the delay set to 3 seconds.

Can somebody give me ideas?

Thanks in advance.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Thu, 2005-04-21 06:23

It's mostly Javascript controlled in modules/slideshow/templates/Slideshow.tpl. Read the instructions at the top of that file and hack away at it. Also try searching these forums for examples since I know that others have also made some customizations to the slideshow.

 
accleas

Joined: 2005-04-20
Posts: 25
Posted: Thu, 2005-04-21 12:47

Go it.
Thanks bharat

 
KAC

Joined: 2004-12-01
Posts: 164
Posted: Thu, 2005-04-21 14:13

accleas,

Can you post how you did it? I did a search and found example posts for G1 but not G2.

I'm looking to make my slideshow defaults be:
Delay = 3 seconds
Size = 1024x1024
Fade = Random

For the delay I changed from this:
<select onchange="new_delay(this.value)">
<option value="1">{g->text text="1 seconds"}</option>
<option value="3">{g->text text="3 seconds"}</option>
<option value="5">{g->text text="5 seconds"}</option>
<option value="10">{g->text text="10 seconds"}</option>
<option selected="selected" value="15">{g->text text="15 seconds"}</option>
<option value="20">{g->text text="20 seconds"}</option>
</select>

To this:
<select onchange="new_delay(this.value)">
<option value="1">{g->text text="1 seconds"}</option>
<option selected="selected" value="3">{g->text text="3 seconds"}</option>
<option value="5">{g->text text="5 seconds"}</option>
<option value="10">{g->text text="10 seconds"}</option>
<option value="15">{g->text text="15 seconds"}</option>
<option value="20">{g->text text="20 seconds"}</option>
</select>

For size I changed from this:
<select onchange="new_size(this.value)">
<option value="0">{g->text text="320x320"}</option>
<option value="1">{g->text text="640x640"}</option>
<option value="2">{g->text text="800x800"}</option>
<option value="3">{g->text text="1024x1024"}</option>
<option value="4">{g->text text="1280x1280"}</option>
<option value="5">{g->text text="no limit"}</option>
</select>

To this:
<select onchange="new_size(this.value)">
<option value="0">{g->text text="320x320"}</option>
<option value="1">{g->text text="640x640"}</option>
<option value="2">{g->text text="800x800"}</option>
<option selected="selected" value="3">{g->text text="1024x1024"}</option>
<option value="4">{g->text text="1280x1280"}</option>
<option value="5">{g->text text="no limit"}</option>
</select>

This did not help. When I opened the slideshow with the these changes, the option for 3 seconds and 1024x1024 were selected but the show still displayed at 15 seconds and 300x300.

I could not find an easy way to change the default fade mode to Random.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2005-04-21 15:08

KAC, in addition to those changes you must also invoke some javascript.. in the bottom of Slideshow.tpl just before // ]]> add this:

new_delay(3);
new_size(3);
document.getElementById('filter').options[15].selected = true;
 
KAC

Joined: 2004-12-01
Posts: 164
Posted: Thu, 2005-04-21 15:39

Thanks Mindless. I'll try that!

One other question. I read the top of the Slideshow.tpl. It says:

Quote:
* If you want to customize this file, do not edit it directly since future upgrades may overwrite it. Instead, copy it into a new directory called "local" and edit that version. Gallery will look for that file first and use it if it exists.

Where does the "local" folder go?
I created it in "public_html\g2gallerymain\modules\slideshow\templates\" but that didn't work.

 
accleas

Joined: 2005-04-20
Posts: 25
Posted: Thu, 2005-04-21 17:01

Re: Where does the "local" folder go?

The local folder should be under ...\templates that is
"public_html\g2gallerymain\modules\slideshow\templates\local"

Then copy the Slideshow.tpl to
"public_html\g2gallerymain\modules\slideshow\templates\local"

Hope you find it helpful.

 
KAC

Joined: 2004-12-01
Posts: 164
Posted: Thu, 2005-04-21 20:11

That's what I did. It ignored it and still used the one in the templates folder.

 
accleas

Joined: 2005-04-20
Posts: 25
Posted: Fri, 2005-04-22 02:04
KAC wrote:
That's what I did. It ignored it and still used the one in the templates folder.

KAC,

Could you also copy
"public_html\g2gallerymain\modules\slideshow\templates\Header.tpl "
to
"public_html\g2gallerymain\modules\slideshow\templates\local"

and try again.

 
G2Newbie

Joined: 2005-05-18
Posts: 11
Posted: Wed, 2005-05-25 09:09
mindless wrote:
KAC, in addition to those changes you must also invoke some javascript.. in the bottom of Slideshow.tpl just before // ]]> add this:

new_delay(3);
new_size(3);
document.getElementById('filter').options[15].selected = true;

What I have noticed with this customization is that the behaviour of "RANDOM" order in Firefox/mozilla is unpredictable! The Photos jumps one or two photos forward when using random fade! Is this familiar for you guys? Is there something to fix? Yes maybe don´t use random fade? :)

Thanks,

NewBie

 
KAC

Joined: 2004-12-01
Posts: 164
Posted: Wed, 2005-05-25 12:14

G2Newbie,

I noticed that too. Since the blends require java, I've stuck to using IE to view my slideshows......it's a shame cuz I loves me Firefox. LOL

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2005-05-25 14:21

Change the code to:

new_delay(3);
new_size(3);
if (bCanBlend) document.getElementById('filter').options[15].selected = true;

The blends do not require java! They require IE.. presumably some activex thing.

 
G2Newbie

Joined: 2005-05-18
Posts: 11
Posted: Wed, 2005-05-25 17:05

Thnx Mindless...

That´s solve the problem but it doesn´t do any filter/effect option. Just straight away..
Is that mean that with Firefox no possibility to add effect on the photo´s? :wink:

Greets,

NewBie

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2005-05-25 17:28

exactly. we use activeX for the effects and activeX isn't available in firefox.

 
kmruss

Joined: 2008-07-12
Posts: 1
Posted: Sat, 2008-07-12 08:09
mindless wrote:
Change the code to:

new_delay(3);
new_size(3);
if (bCanBlend) document.getElementById('filter').options[15].selected = true;

The blends do not require java! They require IE.. presumably some activex thing.

Wow - thank you mindless. This method worked perfectly to set the default FADE option to 'RANDOM'. Amazing this is from 2005. I tinkered with code and got 'RANDOM' set by default - however it also broke the ability to choose any other fade (they were there just didn't work). Thanks for posting this.

This should really be stickied or something since I found at LEAST 5-6 posts that somewhere in them asked about setting the DEFAULT FADE option on the Slideshow - and no one had a working method to do so (modifying the Header.tpl by changing the order is not a good option and eventually causes it to fail in IE with a 'null' reference). I searched for a good 20-30 minutes through posts (not including the other 'code tinkering' time as well) until I found this.

Thanks - Kevin