Configurable CMS block

Screenshot_2020-04-29_at_19.12.41.png Getting started

In this article, you can learn about configurable CMS block functionality, which will allow you to put and properly configure banners visible on a website. There are two defined CMS blocks:

As with every CMS block that is configured to be visible on a homepage it is important to make sure, that created CMS block has exactly the same name as provided above. If the CMS block has a different name it won't be displayed on a website.

POWERPNT_cErzyM5bzz.png
Visualization of the above_cart_steps_banner in a /cart page
POWERPNT_9kZxtbiCk8.png
Visualization of the above_layout_content_banner on a homepage

info2.svg  RememberYou can find more about CMS blocks creation and configuration in the CMS blocks article.

Table of contents:

  1. Configuration

 


 

Screenshot_2020-04-29_at_19.12.41.png Configuration

The new banners are configured exactly like every CMS block, but they have one new field, which manages the properties of the block.

POWERPNT_BHkKZyPLrJ.png
Visualization of the configurable block configuration

In order to see the new JSON field you have to select the configurable block type.

The

Example of a valid JSON:

{"visibility": "all", "closeable": {"position": "top-right", "color": "secondary", "time": 1}, "width": "full-bg", "background": "#0AA78F", "bottomShadow": true}

 

It is possible to configure these blocks to change their state according to users login status (logged in / logged out) and have them still visible for all groups in the visibility property. This needs to be coded in the CMS block HTML content.

info2.svg  RememberYou can find examples of checking of the current cart value and verification of the user logged in / logged out status in the Public JS API article.

 


Revision #2
Created 27 November 2024 21:06:04 by Tau Ceti
Updated 27 November 2024 21:20:27 by Tau Ceti