I'm attempting to use ddblock to create a simple slideshow, from an image folder rather than content.

I'm using the image module, so want to exclude preview and thumbnail image files in the directory (excluding based on a simple string like *preview* *thumbnail*) so that the slideshow only picks up original images.

Anybody know if this is possible?

Not knowing how to do this, I've been attempting to create the same effect with views which seems to be a better documented way of doing this, but with not very much success, at least in regards to keeping the image module.

Apologies if this is a duplicate request, I trawled as much as I could.

Many thanks

Comments

ppblaauw’s picture

Status: Active » Needs review

You can hack the module and replace the following code in the ddblock.module file:

  foreach ($file_array as $value) {
    $file_names[] = $value->filename;
  }

with

  $ignore_strings = array('thumbnail', 'preview');
  foreach ($file_array as $value) {
    $ignore=FALSE;
    foreach ($ignore_strings as $ignore_string ) {
      if (stristr($value->filename, $ignore_string)) {
        $ignore=TRUE; 
        break;
      }        
    }  
    if (!$ignore){
     $file_names[] = $value->filename;
    }  
  }

after the line:

  $file_names = array();

Hope this helps you further, please let me know.

In the next version of the module will try to find a more elegant solution with a field in the UI to exclude file_names.

incredible sulk’s picture

Brilliant, thanks, that worked perfectly. And very useful at the moment with the image module not being very co-operative with views.

ppblaauw’s picture

Status: Needs review » Postponed
Issue tags: +content, +Basic Slideshow

set status to postponed.
Will implement file exclusions in next version off ddblock module.
add tags