Turn your design into Slices

Modeling a Reusable Website Section & Structured Fields

Transcript

[00:00] As you know by now, if you want to recreate this website section, you'll use Slices.

[00:04] Updating a Slice is similar to updating a page type, except you need to think that the Slice can be used across multiple page types.

[00:11] So when you update fields here, it will update on the different pages where Mr. McDonald uses it. This will only affect the API response once a document is republished.

[00:21] You can test this below once the video is finished.

[00:24] This example Slice contains an image field in the non-repeatable zone. This is for fields that appear once per Slice, whereas fields in the repeatable zone can be recreated multiple times in the editor. So if you wanted to create an image gallery, this is where you would add an image field.

[00:39] The image field is a 'structured' field. This means that it has a more complicated output as you're able to configure different settings for this field, such as responsive views. You can edit these settings by clicking the pencil icon on the field in Slice Machine.

[00:53] A rich text field, for example, has many settings you can configure, such as what heading types authors can use, if they want multiple paragraphs or links and simple styling such as bold or italic text styling such as colors and layouts are handled in your project code. We'll learn more about that later.

Main takeaways

  • Slices are models for website sections.
  • Slices can be added across multiple Custom Types.
  • The ‘Non-Repeatable’ zone is for fields that appear once per Slice.
  • Fields in the ‘Repeatable Zone’ can be added multiple times in the editor.
  • ‘Structured’ field types have a complex output, so they aren’t just a string.
  • You can edit a field’s settings by clicking the pencil icon on a field in Slice Machine.

Practice Activity

Test adding new fields in the Slice in this dummy Slice Machine editor and see how it affects the Slice on the Page Builder screen.

Add a Rich Text field with the Field Name of Banner Description field ID of banner_description to the custom type.

Slice Machine
/ Slice/ Banner
Fields
Homepage
  • Save
Revolutionizing farming solutions.
Banner
Text
Banner

Banner
Text
Text

Banner
Text

Answer to continue

Quiz banner

What basic formatting can content authors control with Rich Text?