Custom Blocks are a flexible content feature that can be used for a variety of purposes such as adding custom content that doesn't fit other feature options or adding widgets to your site.
How to create a custom block
- From the Dashboard, click the Custom Blocks tile
- Click Add custom block
-
Title, enter a title for the block
- Tip! This title is both administrative (making it easy to find for editing) and will be the default heading that can be displayed when the block is added to a landing page
- Lanugage, if applicable, select the appropriate Language
-
JavaScript code, add JS code here if you are adding a widget or other content via javascript for the block
- Important! Only use JS code from trusted sources (see the caution below). Users with the Contributor or Editor role cannot add JS code to this field.
- Body, enter the content you wish to display in the block, this could include text, images, videos, and more. See the WYSIWYG editor article for more information on formatting options and field functionality
-
Tip! The 'Save As:' field can be used to set the status of the content for: saving a working draft, for review purposes prior to publishing, or for publishing and un-publishing. Click the drop-down to see the options:
-
Draft, saves your progress as a working draft that can be further edited when needed
- Note: This is the default state for users with the Contributor or Editor role when creating content. Content saved in this state cannot be seen your Stacks site until the status is changed to published
- Needs Review, saves the work in its current state and indicates it is ready to be reviewed by others, typically for approving the content prior to publishing
- Reviewed, saves the work in it's current state and indicates it has been reviewed and could be set to published
-
Published, saves the work in it's current state and publishes the content. This makes the content available in the layout builder for adding to landing pages, or accessible on your site via the URL alias generated when the content was created
- Note: this is the default state for users with the Moderator or Administrator role when creating content
- Unpublished, saves the work in it's current state and un-publishes/removes it from wherever it was added to your Stacks site, this can be set back to published at any time to make it accessible again
-
Draft, saves your progress as a working draft that can be further edited when needed
- Review and adjust any settings in the Publishing workflow if needed
- Click Save when finished
-
Title, enter a title for the block
Caution! Poorly written JavaScript code can potentially expose your website and its users to security risks, compromise data, result in errors or broken functionality, all of which can lead to a poor user experience. Stacks is not responsible for troubleshooting or resolving issues that are a direct result of incorrect or poorly written JavaScript code.
We strongly recommended you thoroughly review and test any JavaScript code before implementing it on your website, or seek help from trusted sources if you are not familiar with JavaScript coding.
Once you have created one or more blocks, the next step is to add them to you homepage or any other landing pages on your site. See the article Adding a Custom Block to a Landing Page for more information on how to do this.