Sample - Alert Bar

On this page, you can check out a demo of the standard Alert Bar template provided by Sitecore Personalize.

Settings

Display Position

The Alert Bar can be displayed at the top or bottom of the page. The setting item is General - Position.

Image
Image

Text

You can change the text used in the Alert Bar. The setting item is Title - Title Text.

Button

You can change the button used in the Alert Bar. The setting item is Button - Button Text for the display text, and Button Link for the link destination.

Code Review

The variables included in the HTML are as follows:

VariableFormatDescription
Title TextstringAlert message
Button LinkstringURL
Button TextstringButton label

HTML Code

The HTML for the Alert Bar is set as follows.

AlertBar.html

JavaScript Code

The JavaScript for the Alert Bar is set as follows.

AlertBar.js