Skip to content

Blocks

Create blocks

To create new blocks, you need to go to the component menu.

PageBlocks menu

Now you can proceed with creating the block itself.

Click the "Create" button, and a modal window appears in front of us.

Create block

Name fieldDescription
NameBlock name
ChunkChunk name
FieldsBlock fields
TabsBlock tabs
AvailabilityBlock availability

Let's create a simple Hero block as an example, which will have 4 fields: title, description, image, and background.

Step 1. Create block

Create block Hero

Step 2. Add the block to the page.

Added block Hero

Step 3. Create chunk

We will use Fenom syntax.

*The chunk name must match the field name Chunk when creating the block.

Create chunk

Chunk hero
html
<section class="hero" style="background-image:url({$background.url})">
    <div class="container">
        <div class="row">
            <div class="col-12">
                <h1>{$title}</h1>
                <p>{$description}</p>
            </div>
        </div>
    </div>
</section>

As you've already understood, the variables $title, $description, and $background are the names of the fields we created when making the block.

Ready blocks

There are situations when the same block is repeated on different pages.

Of course, you can copy the block, but we need the data to be updated on all pages when this block is changed. To solve this problem, we need to add the block to the "Ready Blocks" section.

Step 1. Go to the "Ready Blocks" menu.

Ready blocks menu

Step 2. Add the block just as you would in a resource.

Create ready blocks

Step 3. Add the ready block to the page.

When updating one such block, regardless of where it is located, other blocks will be updated as well.

Added ready blocks

Block synchronization

You also have the option to add synchronization to an existing block. We need to know the ID of the block with which we want to enable synchronization. Usually, we synchronize blocks with predefined blocks, but it's possible to synchronize with any other blocks as well.

Added sync ready blocks

Or remove synchronization to make the block unique.

Remove sync ready blocks

© PageBlocks 2019-present