Emergency

In urgent situations or outages, you can send a text message to our emergency line

Emergency line (text message only)

+45 29 70 15 95

Send a text message with the following information:

  • Your name and webshop
  • A description of the problem

Note: This service is only for critical situations where your webshop is down or has serious problems. For regular support, please use our normal support channels.

Split Blocks: place Page designer blocks above and below the page content

With split_blocks in theme_settings.json, theme developers can split Page designer blocks into two zones: above and below the page's main content. This gives store owners full control over where blocks are placed, from hero banners at the top to a newsletter signup at the bottom.

Reading time: approx. 7 min

What is split_blocks?

In a typical Shoporama theme, Page designer blocks are rendered either before or after the page's main content. That works fine in many cases, but it limits the store owner. What if you want a hero banner above the product list and a newsletter signup below it?

That is exactly what split_blocks solves. When the feature is enabled, the Page designer splits the blocks into two zones:

  • Blocks above the content: hero banners, campaign messages, USP sections, and anything else that needs to catch the visitor's attention right away.
  • Blocks below the content: product recommendations, newsletter signup, Instagram feed, testimonials, and similar supplementary content.

Between the two zones is the page's main content: product information, category listing, checkout flow, or whatever the page shows. This gives the store owner full control over the layout without having to edit templates.

Enabling it in theme_settings.json

To enable split_blocks, add one line to your theme's theme_settings.json file, which is located in the root of the theme:

{
  "info": "My Theme",
  "split_blocks": true,
  "settings": [
    ...
  ]
}

Without this line, or with "split_blocks": false, all blocks are shown in a single list, and they are typically rendered after the page's main content.

The experience in the admin

When split_blocks is enabled, the Page designer changes in the admin. Instead of one combined list of blocks, the store owner gets two separate zones:

  • "Sections above the content": the upper draggable list, where you place blocks that should appear before the page's main content.
  • A visual divider: the text "Main page content" is clearly shown between the two zones, so the store owner always knows where the page's own content is rendered.
  • "Sections below the content": the lower draggable list, for blocks that should appear after the main content.

Blocks can be moved freely between the two zones with drag and drop. The position data is saved automatically, so the store owner does not have to think about the technical side. Just drag the blocks to where they make sense.

Template implementation

In the theme's Smarty templates, two separate variables are used to render the blocks: $page_blocks_top and $page_blocks_bottom. Shoporama fills them automatically based on the position of the blocks.

All you need to do as a theme developer is include them in the right places in your template:

<!-- Blocks above the content -->
<{include file="components/page-blocks.html" blocks=$page_blocks_top}>

<!-- The page's main content goes here -->

<!-- Blocks below the content -->
<{include file="components/page-blocks.html" blocks=$page_blocks_bottom}>

Both calls use the same components/page-blocks.html component. It does not know whether it is rendering top or bottom blocks; it simply renders the blocks it receives. That keeps the implementation simple and consistent.

Complete example: category.html

Here is a complete example of a category page that uses split_blocks. Notice how the blocks wrap around the actual category content:

<div id="main" class="pb-12">
    <!-- Top blocks: hero banners, campaigns, USP section -->
    <{include file="components/page-blocks.html" blocks=$page_blocks_top}>

    <!-- Breadcrumbs -->
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4">
        <{include file="components/breadcrumbs.html"}>
    </div>

    <!-- The category's products, filtering, etc. -->
    <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
        <{include file="components/category-content.html"}>
    </div>

    <!-- Bottom blocks: recommendations, newsletter, Instagram -->
    <{include file="components/page-blocks.html" blocks=$page_blocks_bottom}>
</div>

The pattern is the same across all page types: product, page, blog post, search, cart, checkout, and user profile. Place the top blocks before the main content and the bottom blocks after it. That is all.

When does split_blocks make sense?

split_blocks is relevant for most modern themes, but here are some situations where it is especially valuable:

  • Category pages with hero banners: the store owner can place a campaign banner above the product list and supplementary content below it.
  • Product pages with related content: recommendations and cross-selling below the product information, while a campaign message is shown at the top.
  • The front page: full control over what appears before and after the primary content, without having to edit templates.
  • The checkout flow: trust signals and USP sections above the checkout form, and support information below it.

If your theme only has blocks in one place (for example only below the content), split_blocks is not necessary. But as soon as the store owner needs to place content around the main content, it is the right solution.

Summary

With split_blocks, you give store owners control over block placement on every page, without them having to edit code. The implementation takes one line in theme_settings.json and two includes in each template. It is a small effort with a big impact on the store's layout flexibility.

Read more about the Page designer and how to implement the Theme Builder in your theme. See also our post about accordion layout for theme settings for another useful theme_settings.json feature.

Share this post