I'm in the process of switching my gallery from Gallery to Piwigo, and I'm stuck on one small issue. I like to have my albums show with large pictures for the thumbnails, and the description on the thumbnail too. I figured out how to make an Elegant mod that shows the description, and I see how I can change the thumbnail size with a dropdown, but I don't see where I can change the default size for guest users.
For reference, this is the dropdown contents, I'm trying to default it to large:
Photo sizes
Square
Thumbnail
S - small
M - medium
L - large
This may be something really easy to do, but I've dug around in the code and searched the forums for hours and I still haven't figured it out, so I thought I'd see if anyone can help me. Thanks in advance for any tips.
Offline
Ok, I took another shot at this today and figured out a solution. In category_default.inc.php there's a line that defaults the derivative size to thumbnail. I just changed it to large and now that's the default, but people can still change it if they want.
$template->assign( array( 'derivative_params' => trigger_event('get_index_derivative_params', ImageStdParams::get_by_type( pwg_get_session_var('index_deriv', IMG_LARGE) ) ), 'maxRequests' =>$conf['max_requests'], 'SHOW_THUMBNAIL_CAPTION' =>$conf['show_thumbnail_caption'], ) );
(The change was changing IMG_THUMB to IMG_LARGE.) Anyway, may not be the best solution since I had to change a core file instead of something in my modified theme, but it works.
Offline
Hello
as said many times here and in the Doc Never Ever change the default files
you could have done this by php and/or smarty, in a plugin/custom theme/custom template, but not by changing default files
Offline
Well flop, I read the docs and I do understand why changing the core code is not the best solution, but I didn't get any help from anyone and this worked for me. At least I posted something useful for anyone interested in this topic, which is better than I can say for your reply...
Offline
sorry I'm currently busy trying to improve Piwigo
Offline
Hi Colin,
I have the same question. Have you been able to figure out how to do this without changing the default files? I'd prefer not to do that, but I'm not smart enough to figure out the alternative.
Cheers,
....John
Offline
Hi JohnAnderson,
There is currently (Piwigo 2.7) no configuration parameter to set the default size on "thumbnails page". We have one parameter for default size on photo page but not for thumbnails page. Some themes (I mainly think about modus) offer this configuration parameter.
Offline
thank you for the quick reply PLG.
....John
Offline
and I should have added that we "should" add this parameter in Piwigo core. At least with a "local configuration" like we did for $conf['derivative_default_size'] = 'medium';
Offline
Thanks to ColinB for this thread and a word-around for default thumb sizes. I needed a way to default the square thumb size. I've modified the file "./piwigo/include/category_default.inc.php" with this:
(Line 155:)
Old:
'derivative_params' => trigger_change('get_index_derivative_params', ImageStdParams::get_by_type( pwg_get_session_var('index_deriv', IMG_THUMB) ) ),
New:
'derivative_params' => trigger_change('get_index_derivative_params', ImageStdParams::get_by_type( pwg_get_session_var('index_deriv', IMG_SQUARE) ) ),
I'll gladly move to a $conf[''] variable when it becomes available.
I implemented the work-around at 1:30am so believe me when I say I'm happy I found the post. :)
Offline
@flop25 Can it be done safely now? .. the age of 13' monitors is gone :) .. I really want to change the default to XL (even though this size might be too large for some users).
honestly, I don't believe that any new users understand that it is easy to change the size of the photo.
for me - large decent photos always look better.
tx
Helmuts
Offline
Hi all ,
are there some news / updates concerning the default foto size or is ColinB `s solution ,
dated 2014-07-03 19:20:14 the only one ?
best regards
Offline