Menu order
Put an editor’s most-used collections first in the Studio sidebar.
Arrange the Collections menu
In an Astro site, open src/content.config.ts. Studio reads the keys of the exported collections object in declaration order. To move a collection up the sidebar, move its entry up in that object. Keep the collection keys, loaders, and schemas the same.
For example, Margin defines collections for posts, pages, and photos. To put pages first for an editor who regularly updates them, change the export to the following order. See Margin’s collection definitions
export const collections = {
pages: pagesCollection,
posts: postsCollection,
photos: photosCollection,
};
The editor will see Pages, Posts, then Photos under Collections. The files can stay in their existing folders. To give a menu entry a friendlier label, set title in the folder’s .navigation.yml. Studio also groups some collections that point to a single fixed file. Root-level single files share a Pages entry, and single files in the same named folder can share that folder’s entry. The built-in Website tools have their own fixed positions.
Order items inside a collection
Choose the method that matches what the editor is arranging.
| What to arrange | How to set the order |
|---|---|
| Folders or files in the ordinary content browser | Studio sorts by path and compares numbers numerically. For a new set of folders, names such as 1.introduction, 2.guides, and 10.appendix give that reading order. Studio drops the numeric prefix from the default folder label. |
| Records in an ordered collection or media library | Give records a numeric order field in the collection schema. Lower values appear first. Editors can drag cards to reorder them after clearing search and filters. |
Changing the collection export changes the Studio sidebar. To use a record’s order on the published website as well, have the page that lists those records sort by that field.
Check the result in Studio
Save the configuration and open the website in Studio. For a local checkout, select Refresh local content to pick up the change immediately. For a connected GitHub website, merge the configuration change, then check for and apply the website update in Studio. Open the first collection under Collections and confirm it contains the expected entries.