Statamic allows you to configure "default preferences" that apply to all users. This enables you to specify the columns and the default order they are shown in on the Listing Tables.
Currently, there's no UI for setting default preferences for the listing tables. However, you can easily do this by modifying some friendly YAML files.
- First, find the relevant listing table and click the "Customize Columns" button. It'll open up a modal, enabling you to specify the columns you want to show in the listing table. You can re-order columns from here too.
Repeat this step for any other collections or taxonomies you want to set default columns for.
- Once you're happy, open your user's YAML file. You'll find a
preferences
key containing the columns you just specified:
preferences: collections: articles: columns: - title - date - status
If you're storing users in a database, you'll need to convert the JSON data from the preferences
column in your users
table to YAML. You can use an app like JSON to YAML to do this.
- Next, create a new file called
resources/preferences.yaml
. Copy the contents of thepreferences
array into this new file, resulting in it looking pretty similar to this:
collections: articles: columns: - title - date - status
- Finally, if you clear your user's
preferences
array or login as a different user, the default columns will be displayed just as you specified them. 🎉