Sections and blocks
Themes usesectionsto create your ideal layout. Most sections are made up ofblocks一个特定的函数,如头、text, single images, a collage of images, or links. Using sections and blocks in your templates provides more flexibility in how you arrange your store's content, enabling you to control the look and feel of your online store without the need to edit code. Each template can have up to 25 sections.
Each section has a specific variety of blocks that you can add to it. You can add up to 50 blocks per section. Which sections and blocks are available depends on your theme. For more information about what options are available to you, refer to your theme documentation.
Some sections have limits on the number of blocks that you can add, or limits on the number of blocks of a certain type. For example, theImage with textsection can only display the blocks specified by the theme designer for your theme. InDawn, the free Shopify theme, you can add only one of each of the following blocks:
- a heading
- a paragraph
- a button
You can further customize the section by editing itsSettingsto include an image and choose the alignment, size, background color, and what loads first when customers visit your online store.
If the sections that you add to your store layout don't include the settings or options that you need, then you canedit your theme codeorcontact your theme's developer for support.
On this page
Customize your theme templates with sections and blocks
When you open the theme editor, your store's home page loads by default. You can use the dropdown menu to select a different template, or use the search bar in the template dropdown to search for a specific page type. Selecting a template loads it into the theme editor, and any changes you make are previewed in the editor as you make them.
Add a section
Add a new section to any page in your online store.
Steps:
Edit a section
Duplicate a section or block
Remove a section or block
Some sections have fixed block types and limits. If a limit exists for a particular section or block, then the interface tells you you've used X out of X blocks available. If you've used the maximum number of blocks, then you won't be able to add any additional blocks until you've deleted an existing one.
Working with blocks
Blocks are customizable modules that make up the sections in your page templates. You can use blocks to add text, images, links, buttons, and more.
Shopify themes have sections and blocks that you can customize. Some sections have fixed block types, which means that you can only choose from the blocks made available to that section by the theme designer. Other sections allow you to select any block, but limit the total number of blocks that you can add to the section. If your section reaches the maximum number of blocks available, then a message displays the limit reached, and the+ Add blockoption is greyed out until an existing block is removed.
Add a block
Using metafields and dynamic sources
Metafieldsallow you to display dynamic information on your online store. If you have a theme that supports metafields, then you can connect a metafield to a section or block in the theme editor.
For example, a candle seller might want to display burn times for each type of candle available. After setting up a product metafield for burn time, the seller can add a block for burn time to their product template and then connect it to the product metafield. After setting up a collection metafield for a page that lists burn times, the seller can add a block to their collection template and then connect it to the collection metafield.
You can display dynamic information in your online store by adding sections or blocks that can use dynamic sources. Dynamic sources can be used in any section or block in a product template. In non-product templates, dynamic sources can be used in sections or blocks that show products. You need toadd your metafieldbefore you can connect it in your templates. Refer toDynamic Sourcesfor more information about using metafields and dynamic sources in your theme.
After you complete the setup process, follow these steps to insert the dynamic source into your template: