Jump to content

Recommended Posts

Posted

Hi there,

i am wondering about the possibility to define a fixed size for thumbnails displayed in a page table list.
At the moment ist looks like image 1 - but i would like to get something like image 2!

Is this possible? Thanks 

Cheers Simon
 

01.jpg

02.jpg

Posted

in your config.php

// min: 100, max: 259 default: 130
$config->adminThumbOptions = array_merge($config->adminThumbOptions, array('gridSize' => 100));

Smaller than 100 (like in your screenshot) is not possible using this approach.

I tried this one too but didn't work. (I think it should!)

$config->adminThumbOptions['gridSize'] = 100;

Learn more about this by reading the comment in /wire/config.php

Posted

I think you could use CSS, eg with Admin Custom Files or AdminOnSteroids. Phisicaly images would be the same size but would appear smaller.

Posted
2 hours ago, kixe said:

I tried this one too but didn't work. (I think it should!)

It doesn't because $config->adminThumbOptions is not an array, which you could manipulate. It's just a getter of an object. That's just how php works.

Posted

Not sure how you got the rectangular thumbnails - mine are always square when rendered inside a PageTable, regardless of the the image field settings. Which isn't a bad thing in this case because the solution involves overriding the JS image sizing with CSS and you're not going to be able to preserve the aspect ratio for each image.

These custom CSS settings (use AdminCustomFiles or AdminOnSteroids) gave the result that follows.

.Inputfield_pt_thumbnails .InputfieldImage .gridImage__overflow img { height:100%; }
.Inputfield_pt_thumbnails td:nth-child(2) .InputfieldImage .gridImage__overflow { height:260px !important; width:260px !important; }
.Inputfield_pt_thumbnails td:nth-child(3) .InputfieldImage .gridImage__overflow { height:100px !important; width:100px !important; }

There is no way to identify individual image fields from the markup so you have use nth-child() selectors to target table columns.

Portrait-format images will not fill their frames.

2017-01-16_110804.png

  • Like 1
  • 2 weeks later...
  • 2 years later...
Posted

Just stumbled across this thread and I have a question regarding thumbnail image size in ProcessPageLister grids.

I have this grid in a Process Module:

658716982_Bildschirmfoto2019-07-12um13_22_44.thumb.png.6776a7ba62553a1af373dfd8f124d4c1.png

What I try to do is to resize the thumbnail images in "Product Image(s)" column to 60x60px.

$adminThumbOptions = $this->wire('config')->adminThumbOptions; 
$adminThumbOptions['gridSize'] = 60; 
$this->wire('config')->adminThumbOptions = $adminThumbOptions;

// Instantiate ProcessPageLister with default settings
$this->productsLister = $this->wire('modules')->get('ProcessPageLister');
$this->productsLister->initSelector = '';
$this->productsLister->imageFirst = true;
$this->productsLister->allowBookmarks = false;
...

But this doesn't work although the $config->adminThumbOptions array has the correct value for "gridSize" the thumbnails are rendered 130x130px.

Any hints?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...