# Model custom-template pages as singletons

https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/custom-template-singletons

Create dedicated singleton document types for heavily custom pages, then surface all page types together in a single Studio Pages section using Structure Builder.

---

## Navigation

**Course:** [Migrating from Webflow to Sanity](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity) · [View as markdown](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity.md)

**Previous:** [Build a page builder with a sections array](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/page-builder-sections-array) · **Next:** [Model navigation in Sanity](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/model-navigation)

---

## Course Contents

1. [Introduction](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/introduction-to-webflow-migration)
2. [Audit your Webflow content](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/audit-webflow-content)
3. [Recognize Webflow's content modeling patterns](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/recognize-content-modeling-patterns)
4. [Export from Webflow and connect the Data API](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/export-webflow-connect-api)
5. [Initialize Sanity and install the migration toolkit](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/initialize-sanity-migration-toolkit)
6. [Map collections to Sanity document types](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/map-collections-to-schemas)
7. [Build a page builder with a sections array](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/page-builder-sections-array)
8. **Model custom-template pages as singletons** *(current)*
9. [Model navigation in Sanity](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/model-navigation)
10. [Create a siteSettings singleton](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/site-settings-singleton)
11. [Handle internal links in Portable Text](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/internal-links-portable-text)
12. [Fetch your collection items from the API](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/fetch-collection-items-api)
13. [Run the asset pre-upload pass](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/asset-pre-upload)
14. [Resolve reference fields from API data](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/resolve-reference-fields)
15. [Convert rich text to Portable Text](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/convert-rich-text-portable-text)
16. [Extract static page content using the page DOM API](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/extract-static-page-content)
17. [Import content with the two-pass pattern](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/two-pass-import)
18. [Validate your import in Studio](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/validate-import-studio)
19. [Set up forms, redirects, and sitemap](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/forms-redirects-sitemap)
20. [Set up draft mode and visual preview](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/draft-mode-visual-preview)
21. [Validate your import without a frontend](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/validate-migration)
22. [Launch checklist and DNS transfer](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/launch-checklist-dns)
23. [AI prompt library and resources](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity/appendix-prompt-library-resources)

---

Pages that don't decompose into sections. An About page with a bespoke layout, a Pricing page with a custom grid, and a Contact page with an embedded form don't belong in the page builder. Forcing them into a sections array creates a schema that technically compiles but is editorially meaningless: editors can't compose the layout through sections because the layout is the code.



The right model: one singleton document type per custom page. The document holds only the content fields the Next.js template actually reads. The layout is hardcoded. The document has a fixed `_id` so there's exactly one instance.



### Ask AI to generate singleton schemas for your custom pages



Pull up your classification output from the previous lesson and identify the pages in bucket (d). Then run one prompt per custom page, or batch them:



```text
@webflow/export/about.html @webflow/export/pricing.html @sanity/schemaTypes/objects/seo.ts

Each of these pages has a unique, custom layout that can't be composed from reusable sections. For each page, identify all the editable content fields — headings, body text, images, CTAs — by reading the HTML. Write a singleton document type schema for each page in TypeScript using defineType and defineField. Each schema should:

- Have a descriptive name (e.g. aboutPage, pricingPage)
- Contain only fields the template will query — no sections array
- Include an seo field using the shared seo type from /sanity/schemaTypes/objects/seo.ts
- Save to /sanity/schemaTypes/documents/ (e.g. aboutPage.ts, pricingPage.ts)

Update index.ts to import and register all new types.
```

### Wire all pages into a single Studio section



With page documents for the page builder and singleton documents for custom pages, editors need one place to find everything. Use Structure Builder to create a "Pages" section that aggregates all of them:



```text
@sanity/sanity.config.ts @sanity/schemaTypes/index.ts

Update sanity.config.ts to add a "Pages" section to the Studio sidebar using structureTool. The Pages section should contain:

- A "Landing Pages" list showing all documents of type page (the page builder type)
- One entry per custom-template singleton (e.g. "About", "Pricing", "Contact") — each opens its singleton document directly using documentId matching the type name (e.g. documentId: 'aboutPage')

Use S.listItem, S.documentTypeList, and S.document().schemaType().documentId() as appropriate. Singletons should not be creatable from the list view.
```

The output looks roughly like this, with your actual type names substituted in:



```typescript
// sanity.config.ts (structure excerpt)
S.listItem()
  .title('Pages')
  .child(
    S.list()
      .title('Pages')
      .items([
        S.listItem()
          .title('Landing Pages')
          .child(S.documentTypeList('page').title('Landing Pages')),
        S.listItem()
          .title('About')
          .child(
            S.document()
              .schemaType('aboutPage')
              .documentId('aboutPage')
          ),
        S.listItem()
          .title('Pricing')
          .child(
            S.document()
              .schemaType('pricingPage')
              .documentId('pricingPage')
          ),
      ])
  )
```

Editors see one "Pages" entry in the sidebar. Clicking in shows all page builder pages plus named entries for each custom page. The schema difference is invisible to them.



Confirm Studio compiles and each singleton opens correctly before moving on. If a singleton shows a "Create new document" button instead of opening the document directly, check that `documentId` matches the fixed `_id` you'll assign during import.



Next, you’ll model navigation as its own document type so editors can manage menus independently.



---

## Related Resources

- [Full course as markdown](https://www.sanity.io/learn/course/migrating-content-from-webflow-to-sanity.md)
- [All courses and lessons](https://www.sanity.io/learn/sitemap.md)
- [Complete content for LLMs](https://www.sanity.io/learn/llms-full.txt)

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://www.sanity.io/learn/resource/feedback

```json
{
  "path": "/learn/course/migrating-content-from-webflow-to-sanity/custom-template-singletons.md",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>
