How to Create Custom Blocks in JustCMS: A Complete Guide

Create Unique Data Structures with JustCMS Custom Blocks

Custom blocks are a powerful feature in JustCMS that allow you to create unique data structures for your pages. While JustCMS comes with a variety of standard blocks that can handle most website needs—about 90% of them, in fact—there are situations where a more tailored solution is required. That’s where custom blocks shine.

In this article, we’ll walk you through everything you need to know about creating and using custom blocks in JustCMS, step by step.

Accessing the Custom Blocks Page

To get started, navigate to the Custom Blocks page in the left sidebar. This is where you can create, configure, and manage your custom blocks, just like most other project-related tools in JustCMS.

How to Create a Custom Block

Step 1: Add a New Block

Click on the Add New Block button. This opens the custom block editor where you’ll configure the block details.

Step 2: Name and ID

  • Name: Choose a name that describes the purpose of the block.

  • ID: Ensure the ID is unique to avoid conflicts.

For example, if you’re creating a block for customer testimonials, you might name it “Testimonials” and assign it the ID testimonials.

Step 3: Add Fields

Next, you’ll define the fields that make up your custom block. Fields represent the data you want to collect and display. Let’s walk through an example:

For a testimonials block, you’ll need:

  • Text Field: To store the testimonial message.

  • Text Field: For the customer’s name.

  • Image Field: For the customer’s photo.

  • List Field: To group multiple testimonials.

Here’s how to set it up:

Create a List Field:

Click Add Field and choose List. Name it Testimonials and set the ID to testimonials.

Add Fields to the List:

  • Message: Add a text field for the testimonial message. Make it required and set a minimum length of 100 characters and a maximum of 250 characters.

  • Name: Add a text field for the customer’s name. Make it required with a maximum length of 50 characters.

  • Photo: Add an image field for the customer’s photo and make it required.

Once you’ve configured the fields, save the block.

Using Your Custom Block

Now that your custom block is ready, let’s add it to a page.

  1. Navigate to the Create Page screen.

  2. Click the Custom Blocks icon and select your newly created block.

  3. Fill in the data for each testimonial—add messages, names, and photos.

  4. Save the page.

And that’s it! You’ve successfully created and used a custom block.

Benefits of Custom Blocks

Custom blocks give you complete control over your content structure, allowing you to create tailored solutions for your website. They’re flexible, reusable, and can be integrated seamlessly into your pages.

Next Steps: Reusable Blocks

Custom blocks can also be turned into reusable blocks, which make managing repetitive content even easier. We’ll cover reusable blocks in a future guide, so stay tuned!

Conclusion

Creating custom blocks in JustCMS is a simple yet powerful way to extend your website’s functionality. Whether you’re building a testimonials section, product listings, or custom forms, custom blocks allow you to tailor your site to your exact needs.

Ready to get started? Head to the Custom Blocks page in JustCMS and start building today!