Table of contents

Follow these steps to create new Home Counter block in Magento 2:

1.  Go to Content > Elements > Blocks and press the Add New Block button.

2.1-2.2 Set the Block Title and Identifier. Make sure to use “home-counter” as block identifier for all languages.

2.3 Assign the Block to the Store View where it will be displayed on.

2.4 Click “Edit with Page Builder” Button

3.1 Enter the Block Content with the help of the HTML code element.

3.2 Click “Save”

Note: See Ego-Customer Counter EN Block as your sample content. Just translate the block content based on the store-view language.

That’s it, you should now be able to create the Home Counter Block.

CSS

Use this CSS Code to format the text badge:

<style>
/*Home Counter*/
.homecounter-header {
    color: #ffffff;
    font-size: 30px;
    margin-top: 10px;
    margin-bottom: 15px;
    line-height: 1.4;
}
.header-container .block-search {
    margin-bottom: 20px !important;

}
.homecounter-header p {
    text-align: center;
}
.badge{
    padding: 0.5em 0.5em !important;
    font-weight: 400;

}
.badge-danger{
background-color: #4a4a4a !important;
}
</style>

Badge Code

<div class="homecounter-header"><p> <span class="badge badge-pill badge-danger">Seit 2019 vertrauen uns {{block class="Keyexpress\HomeCounter\Block\Display" template="Keyexpress_HomeCounter::homecounter.phtml"}} Kunden in 119 Ländern</span></p></div>
What are your feelings
Updated on June 17, 2022