Image styles by themes
Component ID
2119107
Component name
Image styles by themes
Component type
module
Maintenance status
Development status
Component security advisory coverage
not-covered
Downloads
3601
Component created
Component changed
Component body
This is a super simple utility module which allows any enabled theme to:
- Declare new image styles
- Reliably alter the configuration of any existing image styles
Usage
- Install this module
- Ensure your theme is enabled,
- On the settings page for your theme, ensure the "Allow this theme to declare image styles" and/or "Allow this theme to alter image styles" box is ticked, as your needs require.
- Create a file of the following name at the ROOT of your theme directory:
THEMENAME.image_styles.inc - Implement whichever of the following two hooks you need:
THEMENAME_theme_image_default_styles()THEMENAME_theme_image_styles_alter()These hooks correspond with the usual image module hooks, with a slight name
change to avoid conflicts. See image_styles_by_themes.api.php for more info. - Clear caches!
Warning
As soon as you disable your theme, all image styles it declared will be removed
from the system. This may lead to seriously broken content if they were being
used.
