CMSB v3.66 Beta (Admin Shortcuts & Developer Console)

14 posts by 4 authors in: Forums > CMS Builder
Last Post: March 21   (RSS)

By KennyH - March 15 - edited: March 15

Admin Shortcut Icons & middle-click shortcuts: These are two new features that I didn't know I had to have. Fantastic! This removes clicks, making it easier to two frequented areas.

Thanks!

By Deborah - March 15

Hey, Chris. I agree with KennyH.

I tested the shortcut icons and buttons and Developer Console - both excellent time savers!

I'm wondering if the beta could be adjusted to accommodate the following two requests:

1) Show thumbnails at actual size when viewed in CMSB
Years ago I was provided the following code edit by IT to allow thumbnails to be viewed at their actual size in CMSB:

In /lib/menus/default/list_functions.php (around line 713):
Original code: showUploadPreview($upload, 50);
Modified code: showUploadPreview($upload, $upload['thumbWidth']);

This doesn't work with beta 3.66 or recent releases. The actual thumbnail image is correctly sized, but is displayed 50 pixels wide in CMSB. I think it might be due to the inline style, but can't find where that code is coming from.
<img src="/_cmsbetaupl/thumb/temp-horizontal_003.jpg" border="0" width="50" height="32" alt="temp-horizontal_003.jpg" title="temp-horizontal_003.jpg">

2) Change WYSIWYG coded line breaks to <br>

When TinyMCE saves code for a WYSIWYG textarea, line breaks are coded as <br />, instead of HTML5 format <br>. This was updated in CMSB to <br> many versions ago, but has now reverted to <br />. I realize either tag format can be used, but prefer <br>, because it doesn't trip the html validator.

------------------------------------

Thanks for continuing to evolve this software!
~ Deborah

By Dave - March 18

Hi All, 

Thanks for testing the beta and any feedback you posted or emailed me directly.  

I've just released Beta 4 with the following changes: 

  • num fields can now be saved in field editor (previously output an error)
  • Fixed double encoding of displayed MySQL column types in field editor
  • Added plugin filter 'listRow_uploadPreviewWidth' - see attached plugin for change upload preview display with on list pages
  • Wysiwyg now outputs <br> instead of <br/>, added element_format: 'html', in /lib/wysiwyg.php
  • Misc Code and other minor improvements.

You can download it here: https://www.interactivetools.com/download/

Let me know if you find any other issues, otherwise we'll release this in the next few days.

Dave Edis - Senior Developer
interactivetools.com

By Dave - March 18

Hi Deborah,

Re-reading your post, I think I misinterpreted what you're wanting with the upload preview sizes.  The reason we limit the width to 50 pixels is to keep the list rows from getting too tall and impacting the usability of the page.  Let me know how you'd like it work and what your particular use case is. 

Dave Edis - Senior Developer
interactivetools.com

By Deborah - March 19

Dave, Thank you for looking at my requests and for making the <br> change.

For the thumbs, I should have been more specific and I was also remembering something wrong.

Thumb sizes in the CMSB list view are displaying at the size I indicate.

Thumb sizes in the image upload preview are hard-coded at 50 pixels wide. I thought those were resizing with my custom code, but now see they were not. With a large batch of uploads, the 50px wide thumbs can make it difficult to determine what the image is without opening the large view. Sorting then becomes more tedious. I understand a larger size would not always be desired.

I located the source of the 50px in /lib/menus/default/uploadList.php and can manually change that size on a per-site basis.

Thanks again!
~ Deborah

By kitsguru - March 19 - edited: March 19

For the image size in the preview, I modified my code to add an inline style that sets the width to 100% and height to auto.

Around line 1233 in cmsb/lib/upload_functions.php, I changed:

  if ($isImage && $bestSrc) { $html .= "<img src='$bestSrc' border='0' width='$bestWidth' height='$bestHeight' alt='$title' title='$title'>"; }

to:

  if ($isImage && $bestSrc) { $html .= "<img src='$bestSrc' border='0' width='$bestWidth' height='$bestHeight' alt='$title' title='$title' style='width:100%; height:auto;'>"; }

For me, seeing the image is more important than the row height.

Jeff Shields

By kitsguru - March 19

I realized that hard coding might not be ideal, so I changed the inline style to a class 'img-preview' and added it to the custom.css file.

NEW Version

  if ($isImage && $bestSrc) { $html .= "<img src='$bestSrc' border='0' width='$bestWidth' height='$bestHeight' alt='$title' title='$title' class='img_preview'>"; }

custom.css

.img_preview {
    width: 100%;
    height: auto;
}
Jeff Shields

By Deborah - March 19

Jeff,

That's a perfect solution - and a responsive/adaptive one, too. Thanks so much for sharing it!

~ Deborah

By kitsguru - March 19

You could modify the css to something like this

.img_preview {
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: 150px;
    margin: 0 auto;
}

This would file the cell but limit the image height to whatever you set it to, and the width would be adjusted accordingly.

Jeff Shields