Order Entries in a Section by Category Titles I currently have entries from a section output simply using a variable like:

{% set beer = craft.entries.section('beverages') %}


All of the beer entries have brands assigned to them using the category field.  How can I display the beer entries by brand? I use that beer variable throughout my templates for entry counts, filters, etc. I'd like to try and keep that in tact if possible.

I tried to use this but it seems to do more than what I need: http://craftcookbook.net/recipes/330.  I also tried the groupBy plugin but had no success in getting that to output anything.
After some further research this http://craftcookbook.net/recipes/279 was a better fit for my needs.  The code I ended up using based on the link is below.

{% set beer = [] %}
{% set beerBrands = craft.categories.group('brandCategory').level(1).find() %}
    {% for category in beerBrands %}
         {% set beerRelatedCategories = craft.entries.section('beers').relatedTo(category).find() %}
         {% set beer = beer|merge(beerRelatedCategories) %}
    {% endfor %}