Thumbnail path issue in generated admin view page code
3 posts by 2 authors in: Forums > CMS Builder
Last Post: Yesterday at 5:38am (RSS)
By Deborah - Tuesday at 4:36pm
I have database section editor containing a photo upload. I set a custom CSS rule in /3rdParty/clipone/css/theme_red.css to to display the full-size thumb image instead of the default size.
/* show thumbnail actual size instead of default 72px by 54px */
.img-preview {
width: auto !important;
max-width: 100% !important;
height: auto !important;
margin: 0 auto;
padding: 2px;
display:
The admin view, such as /cms/admin.php?menu=photos doesn't always indicate the thumbnail image file path correctly. Of 35 photos, 9 were showing the full-size image path in the code, instead of the /thumb/ path.
Example:
9 image paths are /_cmsupl/flwr/img_0660.jpeg
instead of /_cmsupl/flwr/thumb/img_0660.jpeg
- The physical images are sized correctly in the /thumb/ folder.
- Running "recreate" in the field editor for all thumbnails doesn't change anything for the admin view code.
- The Code Generator HTML code is correct.
Just wondering if the cause might be identified so I can show custom-size thumbnails in the admin list view.
Hope my explanation makes sense - thanks for looking at it.
~ Deborah
By Dave - Wednesday at 4:39pm
Hi Deborah,
How's the height/width of the source images that are or aren't getting replaced with thumbnails?
CMSB selects the image that requires the least scaling to display the preview image, thereby saving on bandwidth and load time. So depending on the source image size and thumbnail sizes it might select one or the other.
Can you try having a look at /lib/menus/default/list_functions.php and search for showUploadPreview
$maxWidth = 200;
$maxHeight = 54;
showUploadPreview($upload, $maxWidth, $maxHeight);
If you change these values, does it do what you need? And what are you looking for, for it to show maximum size preview possible? e.g., what's the use case?
Thanks!
interactivetools.com
Dave,
Thanks for the explanation—I understand now and I'm glad everything's working as expected.
On some sites, the images can be so similar that it's hard to tell them apart when they're only 54px high while scrolling through the list.
For my use case, setting both max-width and max-height to the same value achieves the desired result, regardless of the image's orientation.
Appreciate the help—thanks again!
Deborah