Grouping entries and ordering by section Im grabbing entries from two sections and displaying them using the group filter. 

{% set entries = craft.entries().section('extendedEvents, festivalEvents')%}
{% set allEvents = entries %}
{% set allEventsBySection = allEvents|group('section') %}

{% for section, eventsInSection in allEventsBySection %}
- results- 
{% endfor %}


No matter what I do the results are coming back ordered as section2 (entry, entry, entry) then section 1 (entry, entry, entry)

How do I affect the order of the sections when displaying the results?
The suggestion to order by sectionId resolved my issue here. 

{% set entries = craft.entries().section('extendedEvents, festivalEvents'). orderBy({sectionId: SORT_ASC}) %}

As it was, I was working with two sections, so my quick fix was to simply reverse the order of the output of the for loop...

{% for section, eventsInSection in allEventsBySection | reverse %}