Understanding Page Types and Custom Types

Created by Juan Manuel Libera Frometa, Modified on Tue, 30 Apr at 3:23 PM by Juan Manuel Libera Frometa

This guide delves into the concept of page types and custom types, essential building blocks for your content structure.

Types: The Foundation of Your Documents

Types act as blueprints for your documents. They define and configure the fields that hold your content. Whether you're creating pages, posts, articles, events, products, or any other content block, types provide the essential structure.

Single-Use vs. Reusable Types

You can choose to have types for single use only. Examples include a home page, a settings file, or a global banner. Alternatively, you can create reusable types, allowing you to generate unlimited documents based on that type. Landing pages, blog posts, or author profiles are all prime examples of reusable types.

Distinguishing Page Types from Custom Types

Types come in two flavors: page types and custom types.

Page Types: Web-Focused Content

Page types come with pre-defined metadata fields and a dedicated slice zone for constructing the content of web pages. Slice zones function like building blocks, allowing you to assemble your page content with reusable components.

Custom Types: Flexible and Versatile

Custom types offer a more generic approach. They can be used to create menus, taxonomies (classification systems), configurations, and various other entities within your project.

Creating Page Types and Custom Types

Slice Machine provides dedicated sections for creating both page types and custom types.

Crafting Page Types:

  1. Navigate to the "Page types" tab.
  2. Click "Create a page type."

        3. Choose between reusable or single-use, name your type, and save.



Building Slices:

  1. Head over to the "Slices" tab.
  2. Create your slices, defining their models.
  3. Save the models to your file system, synchronize them with your repository, and preview slice simulations with mock data.

Adding Fields to Custom Types and Slices:

Click on "+ Add a new Field" to explore the available field options that can be incorporated into custom types and slices.


Enhancing Organization with Tabs

Custom types offer the option to utilize tabs for organizing your content fields and streamlining document editing. Simply click "+ Add a new tab" within the custom type builder to create a new tab.


Important Note: Remember that using tabs only affects how content is organized within the Page Builder. The document's structure in the API response remains unchanged.

Impact of Modifying Types

Editing a type won't directly alter the existing content in your repository. These changes solely affect the model itself. To see the modifications reflected, you'll need to open and individually save each document.

Deleting a field within a type removes it from the Page Builder. Existing documents will still possess that field and its data until you manually re-save each document. The deleted field will also remain present in the API response until these individual saves occur.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article