Documentation

Search Documentation

Type to search. Use the arrow keys to move through the pages found.

    On this page

    Custom blocks

    When the standard blocks don't give the design you need, CMS Managers can make the Site's own block types. A type has fields that editors fill in, an HTML template from a checked list of elements, and CSS that applies inside the block only. No script runs in a block. Custom blocks lists the Site's types, up to 30.

    Make one

    1. Select New block type.
    2. Give it a Class name (it can't change later) and names in Thai and English. Width on full-width pages says where it sits on a page whose layout is full width: Content width lines it up with the words, as text and cards are; Full width lets its background reach the screen's edges, as a hero's does, while its words stay in line. Two full-width blocks in a row meet edge to edge, so each one's own top and bottom space is the space between them.
    3. In Fields, add what editors fill in. Each field has a name in the template, such as heading. A List of items field has fields of its own for each item.
    4. In Words, add fixed words the block shows in the page's language, such as a button's label.
    5. Write the Template and the CSS. Problems show below each box with their line; select one to go there. Site kit v1 classes under the template lists the classes you can use; the Site kit reference has the template's syntax, elements and CSS rules. A block has no script of its own; for tabs, an accordion, a carousel, a counter or a part that fades in, the template switches on one of Dimdata's behaviours with dd-behaviour. With a type ready as JSON (from Copy as JSON on another type or Site, or from an AI agent), select More actions › Paste JSON instead: it fills the whole form at once.
    6. Select Save draft. The Preview then shows the block on the Site, with sample words. To see it with real words and pictures, fill in Example values for each language; visitors never see them.
    7. Select Publish.

    Use one on a page

    On a page or a shared block, select Add block; published types are under Custom blocks. The block opens to its fields; a List of items field adds items with Add an item. The page's preview shows the type's draft, so a type's changes can be checked on real pages before they are published.

    To go faster, the copy button beside an item duplicates it, ready to change. Copy values puts the block's values on the clipboard as JSON, and Paste values fills the block from JSON in the same shape: field keys with text, numbers, true or false, a picture's ID from Media, and a list as an array of items. Pasted values replace only the fields they name and are checked like a save.

    Share with your other Sites

    A block type belongs to the Site that made it. To use it on your other Sites too, open it and select More actions › Share with all Sites. Every Site of this workspace can then add it to its pages, and its list shows Shared from the Site that made it. It is still changed there, and a change shows on every Site that uses it. Sharing stays within your own Sites; another organization never sees it.

    A type can't be shared while another Site has its own type by the same class name, and Stop sharing waits until no other Site's pages use it.

    Give a block to another organization

    To pass a block type to a partner or another organization, select More actions › Download file. They open the file in their own CMS › Custom blocks with New block type › More actions › Open file, then save and publish it there. Pictures and words on your pages don't go with it: only the type.

    Change, unpublish or delete

    Saving changes makes a draft; the Site keeps the published version until you select Publish changes. History keeps earlier versions to restore as the draft. In More actions, Unpublish takes the type off the Site, and Delete removes a type that isn't published. While pages or shared blocks use a type (listed as Used on), it can be neither unpublished nor deleted: remove it from them first.

    If the workspace's plan doesn't include custom blocks, the published ones still show on the Site, but can't be changed or added.

    Updated