question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Configurable default sort order in the Explorer?

See original GitHub issue

Considering that the Explorer represents the contents and layout of the main site menu, the fact that the default sort order is locked as -latest_revision_created_at is frustrating. It means that you require an extra step (clicking “Enable ordering of child pages”) to see the Menu layout. This is not good UX for site editors who aren’t intimately familiar with Wagtail’s admin UI.

I’d be happy to implement this myself, but I don’t really see anywhere in the admin UI where one can set “site configuration”. Though I suppose it could be useful to have a default that’s tied to a user’s role (users who don’t have permission to edit the menu don’t need this sort order by default), so it could go in the Group editor.

Issue Analytics

  • State:open
  • Created 9 years ago
  • Reactions:1
  • Comments:30 (16 by maintainers)

github_iconTop GitHub Comments

2reactions
gasmancommented, Jan 13, 2015

I’m in favour of having the parent page’s model specify the ordering, and in fact I’d take it one step further: specifying an order should override the manual (menu) ordering. In other words, it’s not just an admin display preference: it governs the actual ordering of pages within the database (as defined by Treebeard’s path field), and newly created (or renamed) pages would be inserted at their appropriate position.

I believe this would negate the need for a user preference: the explorer would default to showing each page listing in that section’s ‘native’ ordering, whether that’s title order, date order, or manually defined. The problem we’ve faced up to now is that the manual sortorder naturally degenerates into randomness unless there’s someone actively managing it - which won’t be the case for a large news / blog / people listing - and so it’s unusable as a default ordering in the explorer, leading us to adopt title or date as the ‘next best’ option. (In turn, this leads to the confusion where people set a manual page ordering and think their changes have been lost as soon as they return to the ‘regular’ explorer view.) By making it possible to tie the menu order to title or date, this change would make the menu ordering relevant and usable again.

2reactions
stepiiiczcommented, Jan 9, 2015

Wouldn’t it be better to have a possibility to set the default sorting in the page model class, e.g. something like the following?

class PeopleSection(Page):
    ...
    class Meta:
        verbose_name = u"Staff"
        children_ordering = "title"
    ...

Nowadays I run several wagtail sites that have different sections for which I would prefer different sorting settings. E.g. in sections with articles you usually want to sort by -last_created_at, but for sections like staff you’d prefer sorting by title etc.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configure the report's default sort - Calabrio Help Center
This control only sets the default sorting direction. In a report with a table view type, select the Sorting tab in the Question...
Read more >
How do I change the default sort order on Windows Explorer ...
Select View tab, Apply to all folders. This will always sort folders for that document type by date since it is the first...
Read more >
Is there a way to change the sort order of Windows Explorer?
Click Start, click Run, type regedit, and then click OK. · Use one of the following methods, as appropriate for your situation: ·...
Read more >
How to alter File Explorer's default sort | TechRepublic
After doing some research, I discovered that Microsoft did indeed deliberately change the default sorting algorithm, starting with Windows XP. I ...
Read more >
Default Sort Order in the Open Dialog Box - Word Ribbon Tips
When Leo displays the Open dialog box (to open an existing document), Word always displays the available documents in alphabetical order, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found