What are Custom Blocks?
Custom blocks are pre-built design blocks by you and collaborators (team members) for the ease of your users so they design content faster by reusing existing blocks. i.e. custom block of "terms and condition" footer. For further information regarding, Custom blocks please visit our documentation.
How can I create Custom Blocks?
For this, you have to:
Login to Unlayer dashboard
Select your Project. If you don't any, then create a new project
Go to Content -> Emails -> Templates and click on Create
Select "Block" and fill in the form.
Click on Create Block
How can I save and load Custom Blocks?
You can save customs blocks in two ways, and that are:
Using Unlayer dashboard: In this case, custom blocks are saved on Unlayer server and are automatically loaded as you initialize the editor with the correct projectID.
Using own server: In this case, if you have saved the custom blocks JSON in your server using Unlayer.saveDesign function then you can load the blocks via following code:
<script>
unlayer.init({
blocks: [
{ /* Block JSON Object */ }.
{ /* Block JSON Object */ }.
{ /* Block JSON Object */ }
]
})
</script>
What are User Saved Blocks?
Your users can save their own blocks and reuse them when designing content in your application. Please note that user saved blocks are visible to respective user only.
How to enable User Saved Blocks?
You can enable user saved blocks by passing a user object with the unique user id. You can also pass a name and email optionally. See example below:
unlayer.init({
user: {
id: 1,
name: 'John Doe',
email: '[email protected]'
}
})
How to create User Saved Block?
Your users can save their blocks by clicking the Save button at the bottom right of a selected row. Once clicked, users have to describe Category Name and optional Tags. These two help your users to better organize and search. See example below:
What is the difference between Custom Blocks and User Saved Blocks?
Custom Blocks are global in scope, meaning they're available to all users of your application. In contrast, User Saved Blocks are private and user-specific. Each user can only access the blocks they've saved themselves and not those saved by others.




