Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wagtail wish list: Ability to put snippets in order so the most used are on page 1. #5608

Closed
1 task done
Tracked by #159
dorothyyeager opened this issue Feb 13, 2023 · 1 comment · Fixed by #5637
Closed
1 task done
Tracked by #159
Assignees

Comments

@dorothyyeager
Copy link
Contributor

dorothyyeager commented Feb 13, 2023

Summary

What we're after:
As a Wagtail user who needs a snippet, it would be good to not have to go to the last page for the one I need.

Right now the snippets are in the order they were created. That means some of the most used ones (contribution limits for 2023-2024) and COVID snippet) are on the last page.

Background information: https://stackoverflow.com/questions/63472227/wagtail-how-to-order-snippets

Completion criteria

  • Snippets for 2023-2024 contribution limits, the COVID snippet and the coordinated party expenditures archive appear on page 1 of the snippet list.
@johnnyporkchops
Copy link
Contributor

johnnyporkchops commented Feb 17, 2023

We could add this to the EmbedSnippet model and it will order the snippets in the Wagtail admin from newest to oldest, putting most recently created on page one.

class Meta:
    ordering = ['-id']

Don't forget to run makemigrations and add the new migration file to the PR.


Note: Wagtail 4 will have a ton of new ways to handle Snippets, including adding sortability in the admin panel, although the implementation looks a bit complex at first glance of the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants