I imported external book cover image URLs into Picture table. I modified PictureService,cs by adding a method to GetPictureExternalUrlById. The display of teh images in product list is fine. However under Admin/Product/List, they are rendered as the original sizes of the URLs, eg. http://cdn.penguin.com.au/covers/original/9780241299807.jpg which is too big to edit other columns, In this case, the following datatable ColumnProperty Width = "100" seems ineffective.
nopCommerce_4.20_Source\src\Presentation\Nop.Web\Areas\Admin\Views\Product\List.cshtml: new ColumnProperty(nameof(ProductModel.PictureThumbnailUrl)) { Title = T("Admin.Catalog.Products.Fields.PictureThumbnailUrl").Text, Width = "100", Render = new RenderPicture() },
How do I change the picture render or set max-width?
I understand that ColumnProperty Width = "100" is only for the width of the column, not the width of the image. How to set CSS or CSS class for the image?
@af1racing Thanks for your suggestion. I've resolved the issue. I have tried to ways. Both are working. Method 1. use ClassName = NopColumnClassDefaults.Image with CSS new ColumnProperty(nameof(ProductModel.PictureThumbnailUrl)) { Title = T("Admin.Catalog.Products.Fields.PictureThumbnailUrl").Text, ClassName = NopColumnClassDefaults.Image, Width = "100", Render = new RenderPicture() //Render = new RenderCustom("renderPicturesColumnProductPictureUrl") },