Is it possible to change the default location users upload their profile photos to? Right now they are stored in /admin/resources/userphotos/ which for me is not preferable for some reasons. I’d rather have them somewhere in html/img/member or similar.
- 677
- 3
- 17
2 Answers
You could add a custom asset field for the users' profile images and hide the default one in the CP.
Here's a plugin to do this: Control Panel CSS by Lindsey D
- 36,220
- 5
- 62
- 139
-
Hackish, but not such a bad idea. – Marcus Scheller Jul 24 '14 at 11:55
Profile photos are saved to craft/storage/userphotos/ by default.
I don't know if you can change the path of userphotos specifically, but what you can do is to change the path of craft/storage/ to your liking by adding this to your index.php:
define('CRAFT_STORAGE_PATH', realpath(dirname(__FILE__) . "/../assets/storage").'/');
Other interesting path constants that you can overwrite like this are:
CRAFT_CONFIG_PATHCRAFT_PLUGINS_PATHCRAFT_TEMPLATES_PATHCRAFT_TRANSLATIONS_PATH
- 36,220
- 5
- 62
- 139
-
(waited to long to edit the above comment)
That’s not exactly what i am aiming at though. I would like to treat userphotos the same way regular assets are being handled. That includes initial transforms at upload which i don’t want. Plus i would rather not have my visitors being able to figure out the system the site is running on by looking up the image path. That’s a requirement right now.
I just could add another asset-field to the users field layout but that would result in a UI conflict since there would be two photo settings.
– Marcus Scheller Jul 24 '14 at 11:27 -
1