Loading...
 
Skip to main content

Features / Usability


Can Slideshow Include Image Title/Description?

posts: 30

When I access my File Galleries (tiki-list_file_gallery.php) and select the "Slide Show" button, I get a nice slideshow of the images in the gallery but not the file title or description. Is there a way to include title and/or description in the slideshow?

Thanks!

posts: 215

Which version of Tiki are you using?

In Tiki 9, there does not appear to be a way to have the title and/or description display in the File Galleries slideshow.

The File Galleries slideshow uses templates/file_gallery_slideshow.tpl, which is able to display that information:

Copy to clipboard
{if ($caption)} {if ($caption eq 'd')} {assign var="itemcaption" value="{$f.description}"} {elseif ($caption eq 'n')} {assign var="itemcaption" value="{$f.name}"} {elseif ($caption eq 'f')} {assign var="itemcaption" value="{$f.filename}"} {/if}

But the "caption" variable only appears to be set when that tpl file is called by PluginFiles. I don't find any way to set the caption variable for the List Galleries slideshow button.

It does mean that you can get a slideshow with titles and/or descriptions using the PluginFiles though.

Tom

posts: 30

Thanks, Tom. Sorry for the delayed response. Still having trouble with forum notifications.

So, yes, I'm using version 9. From what you're saying there's a problem with that version that turns off some List Galleries slideshow capability. Sad to hear that.

I'm quite the newbie. How would you suggest making use of PluginFiles to overcome this issue? Would I make a wiki page to replace List Galleries functionality and somehow call PluginFiles from that wiki page? Seems like it would be best if I could just trick List Galleries into working properly.

Thanks!


posts: 215

I don't know that it would be called a problem, nothing is being turned off.

I just looked through the file_gallery_slideshow.tpl files, and the wikiplugin_files.php for Tiki 2 through Tiki 9.

The tpl file has been around since at least Tiki 1.9, and the plugin Files since Tiki 3. But the option to display the title/description wasn't added to plugin Files until Tiki 9. The option just was not added to the File Galleries slideshow when it was added to plugin Files.

It could be added as an option to the File Galleries. Maybe someone will do it sometime in the future.

I asked if that had been done in any of the Tikis above 9 on irc, and Marc Laporte suggested I try it on demo.tiki.org. I tried it on Tiki 11 and it isn't there yet.

If you want to change the code to get the name or description (it appears I was wrong above, only one or the other can be selected), in /tiki-list_file_gallery.php, the code that calls the tpl file looks like this

Copy to clipboard
$smarty->display('file_gallery_slideshow.tpl'); die();

To get the Description added to the slide show, add a smarty assign above those lines:

Copy to clipboard
$smarty->assign('caption', 'd'); $smarty->display('file_gallery_slideshow.tpl'); die();


Assign an 'n' if you want the name, or an 'f' if you want the file name.

Tom


posts: 30

Thanks, Tom, for the detailed explanation. Couldn't have proceeded without that code.

Turns out that the code works, sort of. It was definitely a step forward. Here are my current issues and perhaps someone may have ideas, or at least this may help others.

Adding Tom's code to tiki-list_file_gallery.php does indeed cause the file description to appear below the photo when the File Gallery "Slide Show" button is clicked. However:

1) The slideshow window doesn't handle the text well. First, while the starting image is loaded, it displays a bullet list of all descriptions of all files in the gallery. Once the first photo arrives and the show begins, the bullet list disappears and photo description are placed below the photos as intended. But they are often truncated (no consistent character count). They also overlap other other items like the "Pause the Slideshow" text, making them unreadable. Brief descriptions work well, but if the description is a sentence or two then display runs into trouble.

2) If the slideshow is instead launched by clicking on one of the Gallery's thumbnails when in "Browse Images" view, the descriptions don't appear. Only when clicking the "Slide Show" button. I trust this is simply due to a different bit of code being used to call the slideshow. Where is that code and can we use Tom's fix there?

So these aren't really gripes. Just trying to take this to the next level. From what Tom says, PluginFiles is a comprehensive solution. But if I understand correctly, PluginFiles has to be called from a wiki page. If possible, I just want to use the built in File Gallery without creating additional overhead with new pages.

Thanks!