Hi,

I'm just wondering if when using 'Group header as the Accordion header', if there is an easy way to control the order of the headers? Right now it seems random and unchangeable.

Thanks

Comments

dbricca’s picture

Priority: Normal » Critical

I am wondering the same thing. There appears to be no way to sort the order that the groups are displayed. Am I missing something, or is it not possible to order the groups?

manuel garcia’s picture

Priority: Critical » Normal
Status: Active » Closed (fixed)

Views accordion does nothing in this respect, it is only a style plugin.

This is a views issue, about how you set it up, nothing to do with views_accordion.

amfriedman’s picture

I would argue that this is a short-coming of either Views or Views Accordion, and also argue that this is currently very difficult to pull off in Views alone, or even in SQL. Someone needs to take responsibility for this oversight, as the desire to order groupings is as common as the desire to order a list of nodes themselves.

Views Accordion builds the header list order in the same order that the first 'n' items output in the view, where 'n' is the total number of distinct values for the grouped header. To change the views or even the query to order ONLY these 'n' items into an arbitrary way and THEN to continue normal sort order of the items that you would specify in a View (e.g., published date DESC), is practically impossible to do in both Views or SQL.

Due to the design of Views Accordion (and plenty of other display formatters) and the way in which the header order is "coupled" with the node output -- in other words -- Views Accordion simply builds the order of the headers in line with the normal node output -- then there will never be a way to have fine-grain control over the header order. This is a design flaw of either Views Accordion or Views itself.