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
Hi patch-works I did something similar with Drupal 7: a block with aniversaries of historical dates. You can see it at https://lassalle-kreis.de/ down in the blue footer, the middle column...
How to get a list of upcoming birthdays?
@indigoxela - I agree, I mentioned the SVG topic specifically for the dev meeting. I think we'll definitely want Nate involved in that discussion. Good call!
Apr 18th Weekly Meetings
Hi colbyat, re display in the browser: the problem is that when a 500 occurs, this PHP process died before being able to render anything. So that won't work. Logging is possible, but...
Displaying 500 errors