Alphabetizing the Block list

Permalink
I'm brand spanking new here, so I apologize if I'm posting this in the wrong area.

I started playing with concrete5 yesterday and installed a few add-ons that provide new block choices. When I go to add a new block to a page, I find the newly added block choices are at the very bottom of the list.

From a usability stand-point (for me anyway), it would make sense if the list of block types was alphabetized. That would make it faster to find the particular item I'm looking for in the list. Is this something that can be easily accomplished?

 
Mnkras replied on at Permalink Reply
Mnkras
I don't think that would be too hard, but if you see the little box at the top of the list, you can type in it and it will filter the blocks by name.

Mike
simshaun replied on at Permalink Reply
Thanks.

If anybody is interested, here is how to go about alphabetizing the list of blocks that appear for you to select when adding a block to an area:

1. Copy /concrete/elements/block_area_add_new.php to /elements/block_area_add_new.php
2. Open the newly copied file in your editor
3. Find (line 7 in concrete v5.4.2)
$form = Loader::helper('form');


4. On a new line after the above-mentioned code, insert this code:
function cmpBlockTypes($a, $b) { 
   return strcmp($a->getBlockTypeName(), $b->getBlockTypeName());
}
usort($blockTypes, 'cmpBlockTypes');