I'm working on a site that has about 10 image styles, and I would love it if the image styles list could be organized in a meaningful way. My first thought was to add a weight to each image style (in code) so that the list would come out organized by my weights. Unfortunately, it does not look like the function image_styles()
sorts by weight, or actually by anything at all.
An easy win for developers hoping to organize their image styles would be to add a call to backdrop_sort
in here.
If it were to first sort by weight, then alpha by name, we'd get the default behavior for non-developers to have the styles sorted alphabetically, which might also be a win.
in the function image_styles()
let's change the last few lines like this:
// Sort the styles by weight, then name.
backdrop_sort($styles, array('weight' => SORT_NUMERIC, 'label' => SORT_STRING));
backdrop_alter('image_styles', $styles);
cache()->set('image_styles', $styles);
Recent comments
Welcome to Backdrop! For your setup, you’ll want to create a subtheme of Bootstrap5 Lite itself; the Bootswatch styles (like Cerulean) are just presets that B5 Lite loads, and you can “lock in”...
Basic Theme designing questions, using Bootstrap5 Lite
Hi Rob, Welcome to Backdrop! Here’s a quick overview: Subtheming Bootswatch: You should create your subtheme based on Bootstrap5 Lite, not directly on a Bootswatch style....
Basic Theme designing questions, using Bootstrap5 Lite
Hi Rolf, This happens because CKEditor saves absolute or semi-absolute paths in the HTML instead of using Backdrop’s file stream wrappers (like public://). When you move your site...
Losing link to embedded pictures when moving my installation