Child pages
  • Custom Static Blocks - Magento 2
Skip to end of metadata
Go to start of metadata


Firefox user notice:

Please use different web browser to view this document.

Sorry for the inconvenience.

Custom Static Blocks - Magento 2

The Magento 2 Custom Static Blocks extension allows web merchants to smartly arrange the layout of their stores via customizable content blocks. For individual customer groups, store admins can create static blocks by choosing the pages where each block should be displayed and in-page block positions. By using conditions, admins can apply each block to a custom selection of products. Finally, the scheduling options enable them to display blocks at specific times and time periods.

Compatibility: Magento Open Source 2.1.X - 2.3.0, Magento Commerce 2.1.X - 2.3.0

Product Page

Thank you for choosing Aheadworks!

Installing Custom Static Blocks

Command Line Installation

1. Backup your web directory and store database;

2. Download Custom Static Blocks installation package;

 3. Upload contents of the Custom Static Blocks installation package to your store root directory;

 4. Navigate to your store root folder in the SSH console of your server:

cd path_to_the_store_root_folder


php -f bin/magento module:enable Aheadworks_Csblock


php -f bin/magento setup:upgrade


php -f bin/magento setup:static-content:deploy

5. Flush store cache; log out from the backend and log in again.


Make sure the installation is done from under the FTP administrator account. Otherwise make sure to set 775 permissions to the store root directory after the extension is deployed.

Composer Installation

1. Log in to your customer account at and navigate to Account -> Composer access;

2. Configure your store to work with the Aheadworks composer repository:

Add composer repository to composer.json by running:

composer config repositories.aheadworks composer in the Magento installation root.

Use a key pair provided as login and pass. You can optionally save them in the global composer auth file.

 3. You can start using AW composer now.

 For extension names, navigate to Account -> Composer access.

 4. Open the root Magento directory on your server and send Composer the following command:

composer require <component-name>:<version>

Note: Use the previously copied component name and version.

 5. Make sure that Composer finished the installation without errors. Flush store cache, log out and log into the backend again.


Getting Around

The extension introduces its section under Content > Custom Static Blocks by aheadWorks > Manage Blocks

Manage Blocks screen is the management center of the extension. Here store administrator can:

  • Create new blocks;
  • Enable/disable/delete existing blocks;
  • Click the block to proceed to the block editing page.

Here store administrator can also adjust the Manage Blocks screen look and feel according to requirements:

  •  button allows adding/disabling the blocks grid columns, some may be excessive and some relevant to your current tasks;
  •  button allows looking for the custom blocks matching a set of attributes;
  •  button allows saving perfect custom blocks grid look you found to quickly load it whenever required.

That is all for the Custom Static Blocks store backend pages. The extension does not have general settings as all the blocks are configured separately.


Creating a custom static block

Click button at the Manage Blocks screen to create first custom block.


At the General section of the new static block page administrator is suggested to define where and how the block will be displayed. The screen offers the following settings:

  • Name - the name of the static block for internal identification purposes;
  • Status - the status of the block:enabled/disabled;
  • Customer Groups - the customer groups the block will be displayed to;
  • Where to Display - on what page types the block will be displayed:
    • Home Page;
    • Product Pages;
    • Catalog Pages;
    • Shopping Cart;
    • Checkout.
  • Position - the position on the page where the block will be displayed:
    • Sidebar top;
    • Sidebar bottom;
    • Content top;
    • Page bottom;
    • Menu Top;
    • Menu Bottom.
  • Conditions - lets store administrator define the conditions on which the static block will be displayed (e.g.: product attributes, category). The setting is Where to Display dependent.

This covers the placement aspects of the Custom Static Blocks.


If you insert a custom static block and some widget in the same page position, the widget will be displayed before the static block (since in Magento widgets have a higher priority than custom static blocks of the module).



Once done with the General section click Content in the navigation menu to your left:


At the Content section of the new static block page administator is suggested to define the static block's content.

The content is defined by the CMS blocks available at your store. Before adding a static block's content make sure you have created appropriate CMS block under Content > Elements > Blocks.

  • To add new content option to the static block click button - it will add a new line of content;
  • In the content line specify the Store View for the CMS block you want it displayed at;
  • Select appropriate CMS block in the Static Block box (if required the CMS block can be edited on spot);
  • Click one more time if you want to add another CMS block.

If two or more CMS blocks added to the static block's content the CMS blocks will ALL be displayed simultaneously ( one after another in the order they have been added to the Content).

Providing Store View setting is adjusted properly this can prove useful for managing a single static block when dealing with store views of different language.

For example:

Lets say you have two store views: English and German.

You can add two CMS blocks with the content in proper language and set English store view for the first one and German store view for the second one.

Thus you can share the same General and Scheduling options for both CMS blocks without creating several Custom Static Blocks.


The final step of configuring the Custom Static Block is the Schedule section.

Here administrator is suggested if the block should be scheduled to display at a set time, or leave the fields blank to manually manage the block activity.

The section is spilt into two sections: Display Block - defines from when and how long the block should be active, and Schedule Patter - defines on what schedule the block be displayed during the Display Block period.

For example:

  • In the Display Block section you have configured block to be displayed from January 1st to January 30th.
  • In the Schedule Patterns you have selected From Monday to Friday;
  • In the From/To Time you have set 8:00 - 13:00.

On such conditions the block will be displayed from January 1st to January 30th on the business week only: Monday, Tuesday, Wednesday, Thursday, Friday. From 8:00 to 13:00.

Such scheduling settings may prove useful if you are intended on running a particular sales campaign to get more customers on business days.

That covers the Custom Static Blocks settings. You may now want to create some static blocks to test the best possible display options.

Product Page

Need Customization?

Magento 2 Custom Development Services by Aheadworks

You can always find the latest version of the software, full documentation, demos, screenshots, and reviews on
License agreement:
Contact Us:
Copyright © 2019 Aheadworks Co.

  • No labels