•  » Themes
  •  » [elegant] Change default photo size for guests

#1 2014-06-22 16:04:54

ColinB
Member
2014-06-22
3

[elegant] Change default photo size for guests

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

 

#2 2014-07-03 18:20:14

ColinB
Member
2014-06-22
3

Re: [elegant] Change default photo size for guests

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.

Code:

$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

 

#3 2014-07-07 11:46:30

flop25
Piwigo Team
2006-07-06
7037

Re: [elegant] Change default photo size for guests

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


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#4 2014-07-07 20:52:16

ColinB
Member
2014-06-22
3

Re: [elegant] Change default photo size for guests

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

 

#5 2014-07-07 20:53:46

flop25
Piwigo Team
2006-07-06
7037

Re: [elegant] Change default photo size for guests

sorry I'm currently busy trying to improve Piwigo


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#6 2014-11-10 15:50:00

JohnAnderson
Member
2014-10-09
7

Re: [elegant] Change default photo size for guests

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

 

#7 2014-11-10 19:25:39

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13877

Re: [elegant] Change default photo size for guests

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

 

#8 2014-11-10 19:32:34

JohnAnderson
Member
2014-10-09
7

Re: [elegant] Change default photo size for guests

thank you for the quick reply PLG. 
....John

Offline

 

#9 2014-11-10 19:42:40

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13877

Re: [elegant] Change default photo size for guests

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

 

#10 2014-12-29 02:31:05

ckong
Member
2014-12-28
4

Re: [elegant] Change default photo size for guests

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:

Code:

'derivative_params' => trigger_change('get_index_derivative_params', ImageStdParams::get_by_type( pwg_get_session_var('index_deriv', IMG_THUMB) ) ),

New:

Code:

'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

 

#11 2016-07-04 23:09:54

helmuc
Member
Maidstone, UK
2013-05-23
73

Re: [elegant] Change default photo size for guests

@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

 

#12 2016-12-14 11:20:35

volare
Member
Bavaria
2016-11-13
22

Re: [elegant] Change default photo size for guests

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

 
  •  » Themes
  •  » [elegant] Change default photo size for guests

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact