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
After alot of trials, i have done the obvious and translated the whole block for different languages with each property condition as follows: ->propertyCondition('langcode', 'en...
How to get the current page language?
Thanks so much! It's working now: I was able to transfer the docroot files to the containing directory without the need for a second database or any manual configuration export/import/sync...
Backup & Migrate Config: There was a problem creating field...database table with the name already exists.
Ah, I see. Sorry, I hadn't clicked the link and assumed it was the instructions for upgrading from Drupal 7. If you are simply copying a site from one location on a server to another, the...
Backup & Migrate Config: There was a problem creating field...database table with the name already exists.