G'day there, thanks for a great module! I'm a bit of a Drupal newbie, so forgive me if this is an obvious question.

I see a title option when specifying individual images, but not for directories.

Is it possible to set a flag so that the image file name gets used as its title? Minus the extension, of course.

It sure would be helpful.

Here's hoping :)

Comments

rhouse’s picture

Assigned: Unassigned » rhouse

Good idea.

Let me have a think about it and get back to you.

rhouse’s picture

Status: Active » Postponed (maintainer needs more info)

OK, some thoughts...

The problem is that with a DIR option, the title, description, and target specified can be given only once and they apply to every image. Since there are three things that might be required on a file by file basis, the filename idea seems a bit limited. Also it would mean you could only have the titles you want if they happen to be in alphabetical order! What if we looked for a file with the same name as the image, but extension .txt? Or some extension unique to slideshow creator? Then the file could contain lines like:

Title: The image unique title
Description: Some details about this image
Link: www.example.com

...where one leaves out anything that should default to the overall value given in the slideshow spec. One could then add or remove image + description files as a pair and get full flexibility without changing the slideshow code.

What do you think of this?

workel’s picture

Yes, I like that idea! An ssc file could house metadata for each image. Great!

It could also be extensible if you ever wanted to add more metadata. You never know ...

It sounds like a relatively straightforward solution, which always helps :)

rhouse’s picture

Status: Postponed (maintainer needs more info) » Fixed

This is now implemented in 6.x-1.42 and 7.x-1.6. Here are the relevant details from the new README.txt:

All images in a directory:

You can create a normal slideshow, but you can scan for more images using

dir=|DIR_IMAGE|RECURSIVE|LINK|TITLE|CAPTION|TARGET|

where:

DIR_IMAGE [required]: the directory that you want to scan for images. The folder base is the default site files folder, generally "sites/default/files".

RECURSIVE [optional]: "yes" if you want to scan recursively or leave it blank

LINK [optional]: "yes" if you want link all images to their own path, or leave it blank, or provide a URL that all images will link to.

TITLE, CAPTION and LINK are applied to all images, but starting with versions 7.x-1.5 and D6.x-1.41, these can be overridden.

Overriding TITLE, CAPTION and LINK for particular images:

When using "dir", you have to specify one TITLE, CAPTION and LINK in the slideshow code and it applies to every image found in the directory. To override, include in the same directory a control file with the same name as the image file, but with the image extension replaced by ".sscctl". For example, the image "fred.jpg" should be accompanied by a control file called "fred.sscctl". In this control file, include any or all of these lines in any order:

Title: The title to apply to this image
Caption: The caption to apply to this image
Link: http://example.com

The "Link:" line may also be:
Link: yes
meaning to link back to this image itself.

Unrecognised and empty lines in the ".sscctl" file are silently ignored.

workel’s picture

Status: Fixed » Postponed (maintainer needs more info)

Looks great, many thanks!

rhouse’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Glad it works for you!

0000sir’s picture

I made a shell script to create .sscctl file from image file name, see http://drupal.org/node/1524232