When using click sort with the table style the default option is always set to ascending

Let's say I have a table with headers (title,date,views,comment count)

I can set the default sort to date and order to descending (Newest) which works great

but when the user clicks on views or comment count then the url link is always set for ascending (Least Popular)
therefore the user must click again to see it descending (Most Popular)

FEATURE: Allow user to specify the click sort default order

IMPLEMENTATION OPTIONS:

1 -This feature could be added as either a drop down list added to each field in the Table style UI

OR

(this could be better but maybe more difficult to implement)
2 - have the click sort default options match up with the Sort Criteria

I'm pretty new to Views and PHP so I'm not sure which implementation would be better or how to do it exactly.

Thanks,

Derek

Comments

funkmasterjones’s picture

Theme.inc line 315

// @todo -- make this a setting
$initial = 'asc';

if ($active == $field && $order == 'desc') {
          $initial = 'asc';
        }
...

I'm not sure where/if this todo is planned. Does anybody know?

In the meantime I hacked this code for default descending which works for my numeric fields, but alpha fields should have default of descending so this is adequate in any way

Derek

merlinofchaos’s picture

It's not currently on my TODO list, despite having an @todo in the code. Probably having some kind of setting for each sortable column in the table style options is the best solution.

merlinofchaos’s picture

Patches are welcome!

dawehner’s picture

merlinofchaos’s picture

Status: Active » Closed (duplicate)

Let's make the one with the patch the actual issue, then!