# Country, region, spot. Every level a page.

> A collection is a tree of pages: surf spots by country, region and spot, each level a page at its own address. Build it by hand or with your agent.

A collection on PixelGlass is a named tree of pages. **Every level is a page of its own**, at an address that follows the tree, and each level can carry fields such as a map point or a rating.

**Early access.** This guide uses a feature in early access. PixelGlass turns it on for a publication on request while it is new.

## By hand, in the admin

1. Open **Pages** and press **New collection**. Give it a name, its levels top first, such as Country, Region, Spot, and an address.
2. Press **Save**. The pages list now browses the collection a level at a time.
3. Press **New Country** to write the first top-level page, then open it and press **New Region** for the pages under it.
4. Press **Fields** to give a level its fields: Text, Number, Yes or no, Link, Choice or Map point.
5. Fill a page's fields and its place in the tree in its **Post settings**, then publish it like any page.

## With your agent

> Make a collection of surf spots by country, region and spot, with a map point and a break type on each spot.

> Add Portugal with its three regions and ten spots in each, as drafts, from the list below.

> Show me the collection's tree, and publish every spot page in Ericeira.

The tools it calls: `create_collection`, `add_collection_pages`, `get_collection`, `list_collections`, `update_collection`, `update_post_settings`, `publish_post`.

## Examples

- **A surf guide by coast.** A surf school builds country, region and spot pages, and **each spot page carries its map point and its break**.
- **Boards by brand.** A board shop keeps a page for each brand and one for each model under it, with the model's length and price as fields.
- **A city's coffee map.** A food writer sorts cafés by district. Her agent adds forty pages in one call, as drafts, and she publishes them a district at a time.

## Questions

### What is a collection on PixelGlass?

A named tree of pages, with up to six levels. Each level is a page of its own, at an address made of the collection and the pages above it.

### Can a collection hold posts?

No. A collection holds pages only, and a page's address is unique among its siblings.

### What are a level's fields?

Values every page on that level carries: text, a number, yes or no, a link, a choice or a map point. Themes and the site's JSON read them.

### Can my agent build a whole collection at once?

Yes. It makes the collection with create_collection and adds a whole branch with add_collection_pages, up to 200 pages a call, all or nothing, as drafts unless it publishes them.

### Who can make a collection?

Editors, admins and the owner make and change a collection, by hand or through their agent.

## See also

- [Make an About page](https://pixelglass.co/guides/make-an-about-page): Write an About page in the editor and put it in your menu, or let your agent build it as a page of its own design. By hand or with your agent.
- [Edit your menus](https://pixelglass.co/guides/edit-your-menus): Change the links in your site's masthead and footer menus. Add, reorder and remove them in Settings › Design, or ask your agent.
- [Use PixelGlass as a headless CMS](https://pixelglass.co/guides/use-pixelglass-as-a-headless-cms): Add .json to any address of your site and read posts, pages, tags and authors with a content key. Write in PixelGlass, show it in your own code.
- [The editor](https://pixelglass.co/features/editor): A calm editor for serious writing: cards for images, video, callouts and buttons, autosave, a history of 50 versions, scheduling and meta data.
- [SEO and AI search](https://pixelglass.co/features/seo): Every PixelGlass site is ready for Google and AI answer engines: llms.txt, a Markdown twin of every post, sitemaps, feeds, structured data and hreflang.
- [Every guide](https://pixelglass.co/guides)
- [Pricing](https://pixelglass.co/pricing): every feature on every plan, 14 days free
- [Create your site](https://pixelglass.co/signup)
