IMCE RC2 mentions a "New box view for file list" which shows thumbnails, instead of a list of filenames. This is very useful.

1. But I find that not all my images are showing as thumbnails (see attached screenshot). It seems these are determined by these figures hard-wired in imce-content.tpl.php. Be much better if these could be configured in the IMCE admin screen.

  imce.hooks.list.push(imce.thumbRow);
  imce.vars.tMaxW = 120; //maximum width of an image to be previewed inline
  imce.vars.tMaxH = 120; //maximum height of an image to be previewed inline
  imce.vars.prvW = 40; //maximum width of the thumbnail used in inline preview.
  imce.vars.prvH = 40; //maximum height of the thumbnail used in inline preview.

2. It would also be better if "Box view" could be selected by the click of a button. At the moment, I have to remove the // rem statements from the file imce-content.tpl.php.

  //enable box view for file list. set box dimensions = preview dimensions + 30 or more
  /imce.vars.boxW = 100; //width of a file info box
  //imce.vars.boxH = 100; //height of a file info box

  //imce.vars.previewImages = 0; //disable click previewing of images.
  //imce.vars.cache = 0; //disable directory caching. File lists will always refresh.
  //imce.vars.absurls = 1; //make IMCE return absolute file URLs to external applications.

Images:


-------x-------


-------x-------


-------x-------

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

iantresman’s picture

FileSize
89.73 KB

For reference, these are the values I have set in imce-content.tpl.php, to display thumbails of all images not larger than 640x640, as thumbnails at 96x96 (see attached screenshot):

  //inline preview
  imce.hooks.list.push(imce.thumbRow);
  imce.vars.tMaxW = 640; //maximum width of an image to be previewed inline
  imce.vars.tMaxH = 640; //maximum height of an image to be previewed inline
  imce.vars.prvW = 96; //maximum width of the thumbnail used in inline preview.
  imce.vars.prvH = 96; //maximum height of the thumbnail used in inline preview.
  //imce.vars.prvstyle = 'stylename'; //preview larger images inline using an image style(imagecache preset).

  //enable box view for file list. set box dimensions = preview dimensions + 30 or more
  imce.vars.boxW = 132; //width of a file info box
  imce.vars.boxH = 132; //height of a file info box

  //imce.vars.previewImages = 0; //disable click previewing of images.
  imce.vars.cache = 0; //disable directory caching. File lists will always refresh.
  imce.vars.absurls = 1; //make IMCE return absolute file URLs to external applications.

Hoping that (a) all these can be configured in IMCE admin (b) The thumbnail could show the actual images size dimensions.

iantresman’s picture

FileSize
155.81 KB

It seems that the new thumbnail "Box view" display has a toggle button in the top-right corner (next to the Help icon) to switch between the filename list mode. See attachment.

ufku’s picture

It is an experimental feature. Let it stay in theme layer for now.
You should enable prvstyle feature for large images. Create an imagecache preset that scales to (imce.vars.prvW, imce.vars.prvH) and it will handle images larger than (imce.vars.tMaxW, imce.vars.tMaxW). Otherwise, it's an overkill to load tens of high res images.

iantresman’s picture

A very welcome experimental feature!

For the benefit of others, imce.vars.prvstyle is also set in tpl/imce-content.tpl.php, as can be seen in the code snippet in message #1 above.

ufku’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

pixelsweatshop’s picture

Loving this feature. Can't wait for it to be easily configurable in the UI

fugazi’s picture

Subscribe

ShaneOnABike’s picture

+1 This has been implemented but it's not really documented anywhere. Couldn't this just be turned on by default I think it's a pretty useful tool?

iantresman’s picture

I've had this working on several sites now, and enable it by default on all new ones. Any chance it can be made mainstream by providing an IMCE configuration options (per those in tpl/imce-content.tpl.php.) to:

  1. enable/disable it
  2. specify max box width/height
  3. thumbnail width/height
  4. box dimensions,
  5. enable/disable imce.vars.prvstyle / imce.vars.cache / imce.vars.absurls,
  6. Choose default views (file/box)
chunty’s picture

+1 Great stuff For best practice enable this in your theme js and not the template file

marcoka’s picture

is this also avaliable in d7?

augustynen’s picture

Same question here ... How to in D7 ?

Woops, sorry, if other people are looking for this to in drupal 7:

Go to imce-content.tpl.php
you have to set it there by uncomment the code

These are my settings:

<script type="text/javascript">
<!--//--><![CDATA[//><!--
  imce.hooks.load.push(imce.initiateShortcuts); //shortcuts for directories and files
  imce.hooks.load.push(imce.initiateSorting); //file sorting
  imce.hooks.load.push(imce.initiateResizeBars); //area resizing

  //inline preview
  imce.hooks.list.push(imce.thumbRow);
  imce.vars.tMaxW = 1200; //maximum width of an image to be previewed inline
  imce.vars.tMaxH = 1200; //maximum height of an image to be previewed inline
  imce.vars.prvW = 96; //maximum width of the thumbnail used in inline preview.
  imce.vars.prvH = 96; //maximum height of the thumbnail used in inline preview.
  //imce.vars.prvstyle = 'stylename'; //preview larger images inline using an image style(imagecache preset).

  //enable box view for file list. set box dimensions = preview dimensions + 30 or more
  imce.vars.boxW = 132; //width of a file info box
  imce.vars.boxH = 132; //height of a file info box

  //imce.vars.previewImages = 0; //disable click previewing of images.
  imce.vars.cache = 0; //disable directory caching. File lists will always refresh.
  imce.vars.absurls = 1; //make IMCE return absolute file URLs to external applications.
//--><!]]>
</script>

Be shure that the imce.vars.tMaxW and the imce.vars.tMaxH is the same as your max image size in IMCE settings...

augustynen’s picture

Still a problem:
when enabling this feature I get the error:
The selected file could not be used because the file does not exist in the database.

Anyone knows what to do.

augustynen’s picture

Solution:

The selected file could not be used because the file does not exist in the database.

in the imce-content.tpl.php file:

 imce.vars.absurls = 0; //make IMCE return absolute file URLs to external applications.
vchen’s picture

This may be a dumb question, but if you edit the imce-content.tpl.php file, wouldn't the next upgrade wipe out your settings? How do you keep your settings saved?

thalles’s picture

Issue summary: View changes