Building Blocks


We follow the DRY (Do not repeat yourself) principle. A block is created to make the block of code reusable and could be attached to one to many screens throughout your whole site.

For best practices, we encourage to narrow the scope of a block to make it modular so that it could be attached to any screen, if desired.

Each block is independent and could be attach to any screen throughout your application. A block is a block of code that shares the same resource type.

Example of blocks:
a. Navbar
b. Footer
c. Blog Loop - collection of posts.
d. Blog Overview - post overview.

To attach a block into a screen, go to the screen you want to attach the block to and add all the blocks.

This line of code adds the contact block to the screen.

{{ blocks.contact.body }}

Let's disect the line of code above. blocks is the generic collection of blocks in an app. contact is the name of the block and body is an attribute of the contact block which renders the code in that specific block.