The default setting of slideshow seems to be an automatic loop of all images in an album. I would like to:
- disable loop by default, so that all images in an album are shown only once (e.g. when user starts slideshow at image 4, all images will be shown until the end, and then back from the beginning until image 3;
- show checkbox to enable slideshow loop;
- show the "status" of the slideshow in the slideshow window, e.g. "image 3 of 20" or something. I tried to put the "navigator" block in the slideshow.tpl, but that didn't work.
Thanks for any hints ...
Posts: 32509
on http://codex.gallery2.org/index.php/Gallery2:How_Tos there is linked a related howto.
Posts: 238
In addition to valiant's direction, try this site's new Feature Voting system to vote for the "[G2] Set general slideshow-options in siteadministration" if you'd like to see the ability to control looping in your Gallery added to the admin interface.
Not that I'm trying to influence voting
Posts: 134
Thanks, but this topics only discuss setting the timer delay and the image size (and these topics did help me in doing that!!).
My question was about the default loop setting and adding the "current" bit of the navigator in slideshow.
Posts: 134
Since this functionality didn't seem to exist, I modified the slideshow module with additional functionality:
- by default, "loop" is disabled. A user starting slideshow at image 5, will be shown all images in the album, going back to the beginning, and ending again at picture 5.
- a checkbox "loop" is added, where user can enable the loop function. When unchecked again (after all images in album have been shown), the slideshow will stop at the current image.
- the "navigator" is added: "< previous" will do exactly that ("back one image" in old slidshow); "next >" will allow user to go quickly to the next image; and user will always see where she is in the album (e.g. 5 of 23);
- slideshow is integrated in overall site template;
- breadcrumb is added on slideshow page;
- identical lay-out / look & feel between photo page and slideshow page;
- I disabled the fancy transitions (for some browsers only), which only distract from the photo.
To see it in action: http://www.mir-w-art.org/photos/v/
(it's in french, but straigthforward to navigate; only this: "Lancer un diaporama" = "launch slideshow")
If anybody is interested, I can post the updated slideshow.tpl and .css (based on Siriux) somewhere (where?).
[edit]links added in post below
Posts: 794
Seems to loop even not checking the box with Firefox.
Warren~
Posts: 134
Warren, thanks for confirming this problem. I was already working on it, and I think this happened because when the first loop ends, it takes more time loading the new page (the photo.tpl one) than continuing the script... This only happens when you choose a "high speed". For me, the problem only occured at 1 second. Can you let me know at what slideshow speed this happened for you?
Anyway, I modified the script (after the call to the new page, I immediately set the speed @ 10 seconds, this should give the webserver & browser "enough" time to load the new page), and now it's working (FF & IE6). Could you also test again? Thanks.
Posts: 794
Yes it tested good this time! I tested with a different album too and both tests were with the default 3 second rotation. Looks great! Looking forward to getting this going.
Warren~
Posts: 134
thanks. i'll clean up the code a bit and attach the files later.
Posts: 134
Attached are the modified .tpl files of the customized slideshow module as developed for http://www.mir-w-art.org/photos/v/
Some of the labels are written in French because I have no experience in updating translation files (.po and .mo), but it's easy to modify them in the .tpl files.
Page lay-out is mostly driven by the theme.css file; the theme used on mir-w-art.org is mwg2, which is a variation of siriux, therefore not officially published (but willing to share on request).
Posts: 12
hiya,
this is exactly what I'm looking to do - your zip file appears to be corrupt though
Posts: 134
I re-tried the zip file and it worked (both 7zip and XP).
Anyway, this are links to the files on my server:
http://www.mir-w-art.org/temp/Slideshow.tpl
http://www.mir-w-art.org/temp/Header.tpl
If you like them, please help me in pushing a feature request (that I'd love to see in the next G2 version) on the priority list. A description and ref n° in this post: http://gallery.menalto.com/node/37280#comment-137389
Posts: 12
cheers - duly voted for
could I ask how you acheived your "Lancer un diaporama" link without showing any of the links to the other blocks ith the same user permissions
Posts: 134
There are basically only 2 users: myself (admin) and the rest of the world. To prevent that I have all the other links when I'm logged in, I put the itemlinks call within an if statement:
For the "rest of the world" (users that are nog logged in), there are no other blocks enabled, hence the only link I have in the itemlinks list is the slideshow, so it is not an issue for me, but, I agree, not very "clean".
I know others on the forum have asked (your own post here, another one here) this question (simple link to slideshow), but I have not seen an answer until now. To make my code a bit cleaner (maybe later I want to activate some other links as well) I tried to add an if statement that tests ($item.moduleId=slideshow), but I couldn't get the syntax right, so I left it as it is.
Posts: 134
after some more trying, I found the right syntax to only display the "View slideshow" link:
Posts: 210
Which file?
grep -r "$theme.itemLinks" matrix/
matrix/templates/album.tpl: {g->block type="core.ItemLinks" item=$child links=$child.itemLinks}
matrix/theme.inc: 'systemLinks', 'itemLinks', 'itemSummaries', 'permissions',
matrix/theme.inc: $dataTypes = array('owner', 'parents', 'systemLinks', 'itemLinks', 'permissions',
matrix/theme.inc: 'itemLinksDetailed', 'itemNavigator', 'imageViews');
Posts: 134
short answer: in the album.tpl and/or photo.tpl files.
(certainly not in any .inc file).
longer answer: it depends on the theme and on what modifications you made already. Wherever the Item Links are shown, you can put the call in this if-statement. But watch out, when logged in, you need somewhere a full list of all the Itemlinks ("edit album", "delete photo", ...). If there is only one call to the itemlinks, you can do something like this:
Posts: 210
I want to modify the matrix-theme and/or the hybrid-theme and the slideshow link should not displayed, if only albums and no pictures exist in this level.
Could you please tell me, if the above code is ok to put in album.tpl? I don't think so, I don't want to make no difference between a logged-in user or none. It doesn't make sense for a logged-in user to click on the slideshow-link to get an error-message later, if no photos are present.
Posts: 134
pinguin, with matrix and hybrid theme, you'll have to edit (or put copy in /local) the ItemLinks.tpl file you can find in \modules\core\templates\blocks\
(and not the album.tpl file; that's only in case you use siriux theme and its derivatives)
I modified the file to not show the slideshow link when there are no photos in the album, but only sub-albums.
you can find the file here.
Posts: 210
peter_k thanks a lot. I don't understand why I couldn't open "modules/core" with Konqueror (fish://) but with the bash. Anyway I edited the file with vi.
drwxr-xr-x 8 user group 4096 Sep 29 13:16 core
SLideshow has gone, but a line remains. Probably this occurs, since I edited some part of matrix and don't know what it was. I remember only, that the description width became larger afterwards. It could be that the line is part of the sidebar. Does a "top-line" in the sidebar exist?
I mean there is the logo an top. Then there are 2 lines, in between there is the top level description and below there is a 3rd line. I don't want to post the url of the album here, since it is under construction. But if you want I can send you a private message, to have a look at it.
Posts: 210
In the meantime I found out, that there is a difference between a logged in user and none. If a user is logged in, it is the line under comment and other editing tasks on the left side. If no user is logged in, all "links" on the left side are gone, but the line stays.
Posts: 8
peter_k,
I've replaced my ItemLinks.tpl with yours but the "View Slideshow (Fullscreen)" still shows up. Do you have another snippet of code we can add to solve this?
Thanks
Posts: 134
well, this only works for the normal slideshow module, not the fullscreen version (which I don't have installed). you'll have to check what the moduleId is of that module (you'll find this if you switch on the buffered debug mode), and change this line of code:
into something like this:
and replace __fullscreenslideshow__ with the real moduleId.
Posts: 8
Thanks peter_k! It worked using {if ($link.moduleId == "slideshow") || ($link.moduleId == "slideshowapplet")}
Now I'll have to figure out how to get rid of that extra line it draws in the sidebar...
Posts: 168
Hi Peter -- thanks VERY much for this slideshow module which I've wished for for some time. A question: when I call the slideshow from either the photo page or the album page and I let it terminate naturally (not clicking STOP), then after the last image displays it returns to the root album (Gallery front page) rather than either the album or the photo. Do you get the same results? I'm using the G1 theme if that makes any difference.
Posts: 134
Nick, glad you liked it.
I don't know why it goes back to the root page. (you are using G2 right? just with the G1 *theme* ?)
Tried mine on FF & IE6, and it works as intended: the slideshow stops at the same photo that it started with when you let it terminate naturally.
You can read through this post to get some more info on what the module does when you click on "stop", but not sure it's relevant for your problem...
I looked again through the slideshow.tpl file to see where it can go wrong. The return page after the slideshow terminates is defined by this statement (in the "else" in the goto_next_photo function):
You can start with looking into the variables in the debugging window why this doesn't bring you back to the photo, but to the G2 start page. I guess this is a G2 default when there is an error in the g->url call?
Good luck !
Posts: 2
Since Gallery2 changed the way those links are included (they're just a block as far as the theme's template is concerned), here's a modification to the slideshow code that does the same thing:
Index: module.inc
===================================================================
RCS file: /cvsroot/gallery/gallery2/modules/slideshow/module.inc,v
retrieving revision 1.36
diff -r1.36 module.inc
65a66,72
> $containsNonAlbums = false;
> foreach ($items as $item) {
> if (!$item->getCanContainChildren()) {
> $containsNonAlbums = true;
> break;
> }
> }
68c75
< if (isset($wantsDetailedLinks[$itemId])) {
---
> if (isset($wantsDetailedLinks[$itemId]) && $containsNonAlbums) {
Posts: 171
1st problem:
i don´t know why that is, but when i change just a thingy like the french language peter_k included in his really really great slideshow template my slideshow produces errors like not showing ":" or showing strange dots instead of the photo slideshow count . this is due to encoding of firefox which automatically switches to utf8 in slideshow. when not changing anything this doesn´t happen!!!!????
any similar errors around?
2nd problem:
when i try to comment out the showing of the date in the navbar2 on the bottom of the slideshow the numbers in "1 de 23" in the navbar one also disappear!! what to do about it?
!!!
----------------------------------
(both solved with a lot of fantasy and copy and paste trying around- the tpl file now looks like a battle field though )
----------------------------------
!!!
ffaabbiiaann.de/gallery
cheers
fabs
p.s.
thank peter! exactly what is missing is slideshow customization in admin area!!!
Posts: 171
anybody managed to change the language files for this really great and needed modification yet? don´t ask me.. i have no idea
tanks a lot peter_k
Posts: 51
I translated the files peter_k created into English (see attached zip). They're working great on my site (using Gallery 2), however I discovered that some extra customization is needed in the slider theme to be sure that the "slideshow" button (bottom left) is set on the default speed you want.
Don't forget to change the text underneath title in "header.tpl" so that it corresponds to your site!
Posts: 13
I start using Gallery 2 nowadays and find it great. However, I want to modify the NavBar for the photo page such that it has the form
<left>First Previous</left> <middle>Slideshow</middle> <right>Next Last</right>
and I need help on that. Anybody helps me to make such a modification? Thank you.
Currently, I am using the matrix theme, but I believe that the modification can be done similarly for other themes as well.
Posts: 13
Also I want to prevent slideshow to start a new window/tab.
Thank
Posts: 132
Ok, works for me on gallery 2.2.1
but only works for the normal slideshow
This patch doesn't works with the module slideshowapplet
why ?
Posts: 132
Ok, This patch works with the module slideshowapplet too
I had a problem of cache, sorry
Thanks ;)
Posts: 135
This isn't working for me - I'm using Gallery version = 2.3-svn core 1.2.24
I guess things have changed too much.
Any ideas?