Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.




Section


Column
width50%

Table of Contents

Warning

Firefox user notice:

Please use another web browser to view this document.

Sorry for the inconvenience.



Column
width30%

                                                                                                                                                                                                   


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.4.X, Magento Commerce 2.4.X

Product Page


...

Command Line InstallationComposer Installation


Panel
borderWidth2px
borderStylesolid

1. Backup your web directory and store database


Panel
borderWidth2px
borderStylesolid

2. Download the Custom Static Blocks installation package


Panel
borderWidth2px
borderStylesolid

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


Panel
borderWidth2px
borderStylesolid

 4. In SSH console of your server navigate to your store root folder:

No Format
cd path_to_the_store_root_folder

run the following command: :

No Format
php -f bin/magento module:enable  Aheadworks_Csblock

then:

No Format
php -f bin/magento setup:upgrade

after:

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


Panel
borderWidth2px
borderStylesolid

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


Note

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




Column
width50%


Panel
borderWidth2px
borderStylesolid

If you are installing an extension from Aheadworks for the first time, you need to add our composer repository to your Magento store:

Panel
borderWidth2px
borderStylesolid

1. Login to your ssh console and navigate to your store folder:

Panel
borderWidth2px
borderStylesolid
cd path_to_the_store_root_folder

Run the following command:

Panel
borderWidth2px
borderStylesolid
composer config repositories.aheadworks composer https://dist.aheadworks.com/

After the command was executed successfully, you can use the composer to install the products.



Panel
borderWidth2px
borderStylesolid

To install the extension:

2. Login to your ssh console and navigate to your store folder:

Panel
borderWidth2px
borderStylesolid
cd path_to_the_store_root_folder



Panel
borderWidth2px
borderStylesolid

 3. Run the following command to install the latest version of the extension:

Panel
borderWidth2px
borderStylesolid
composer require aheadworks/module-csblock

if you need to install a specific version, run this command:

Panel
borderWidth2px
borderStylesolid
composer require aheadworks/module-csblock:<version>


Tip

Specify the version of the extension in <version>


Panel
borderWidth2px
borderStylesolid

When prompted, enter Public Key (Username) and Private Key (Password):


Note

Both Public Key (Username) and Private Key (Password) can be found in My Projects and Licenses in your personal account on our site:

Image Modified



Panel
borderWidth2px
borderStylesolid

4. Enable the extension:

Panel
borderWidth2px
borderStylesolid
php -f bin/magento module:enable Aheadworks_Csblock

Next, register the extension:

Panel
borderWidth2px
borderStylesolid
bin/magento setup:upgrade

Recompile your Magento store if you are in the Production mode:

Panel
borderWidth2px
borderStylesolid
bin/magento setup:di:compile

To verify that the extension is enabled, run this command:

Panel
borderWidth2px
borderStylesolid
bin/magento module:status

Clean store cache, by running the following command:

Panel
borderWidth2px
borderStylesolid
bin/magento cache:clean

Log out and Log in the backend again.


Panel
borderWidth2px
borderStylesolid

To upgrade the extension:

5. To update or upgrade an extension:

Download the updated extension file. Take note of the module-name and version. Export the contents to your Magento root.

If a composer package exists for the extension, run one of the following.


Code Block
titleUpdate per module name:
composer update aheadworks/module-csblock


Code Block
titleUpdater per version:
composer require aheadworks/module-csblock:<version>

Run the following commands to upgrade, deploy, and clean the cache.

Panel
borderWidth2px
borderStylesolid
php bin/magento setup:upgrade --keep-generated
php bin/magento setup:static-content:deploy
php bin/magento cache:clean





Getting Around


Section

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:

  • Image Modified 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

Section

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

General

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.


Note

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).

Content

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 on the '+' 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 on the '+' icon one more time if you want to add another CMS block.
Info

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.

Schedule

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?

You can always find the latest version of the software, full documentation, demos, screenshots, and reviews on on http://ecommerce.aheadworks.com
License agreement:  https://ecommerce.aheadworks.com/end-user-license-agreement/
Contact Us:  httphttps://ecommerce.aheadworks.com/contacts/contact
Copyright © 2021 Aheadworks Co. http://www.aheadworks.com

...