Over the past couple of weeks, we’ve had a number of Magento admins seek advice on adding important COVID-19 information to their website. Magento2 is a feature-rich eCommerce engine, so there are many ways to add important notices -and many things you can do to configure and customize the content to your liking.
In this post, we’ll be taking the most simple and straightforward route. We realize that the technical resources admins typically rely upon to do “web work” may not be as readily available or accessible as they were a few short weeks ago. So if you need to communicate important information on your website – quickly and prominently – and your tech guy/gal is currently unavailable, this post is for you.
Step 0: Here’s What We’re Doing
You want to post important information on your website that makes visitors aware of your operations and activities during the COVID-19 pandemic. You will be creating a Static Block of content that will be visible to visitors on your homepage. The static block will contain basic information, with a button/link to the full text of your notice.
Step 1: Prepare and Post Your Content
Management has likely provided you with the text/content that they want you to communicate to site visitors. Create and save a new webpage or post containing the content. Most companies use a CMS application such as WordPress, Drupal, or Joomla.
Ensure that the webpage is “live” and that you’re happy with the content and appearance before moving forward.
Step 2: Create A New Static Block in Magento 2
|A. Log into the Magento Admin Console. Navigate to “Content” and choose “Blocks under “Elements”.
|B. Create a new block by clicking “Add New Block” (Usually a prominent orange button in the upper right-hand side of the screen). Fill in the basic details that describe your block and which sites/site views will display that block.
|C. Scroll down the page and use the layout and content tools to create and format your block. In this example, we’ve added a single row and two columns. One column contains text; the second column contains a button that links to the notification content (the page created in Step 1).
Hover over an element to see formatting options (e.g. click the gear icon to manage button settings, add the link, etc.). Once you’re finished, be sure to save your new block.
Step 3: Add Your New Block to the Desired Page(s)
Now, we’re going to add the new block you just created to the appropriate pages and page locations on your website.
|A. In the Magento2 admin console, navigate to Content > Pages. A list of pages will appear. Find the page where you want the block to appear. The last column on the list of pages will (usually) be “Actions”. Click the blue arrow in the Actions tab and select “Edit”|
|B. Click to expand the “Content” section and add a block to the page via the layout tools on the right-hand side of the screen (drag & drop). Drag further if needed to position the block correctly on the page.
|C. Hover over the empty block that you just added to the page layout and click the “Settings” icon (looks like a gear).
|D. Click “Select Block” and choose the COVID-19 block you just created from the list. You may also perform additional formatting and positioning of the block on the webpage. Once you’ve selected the block and completed formatting (if any), click “Save” in the upper right-hand corner of the screen.
Once you click “Save”, you’ll be taken back to the page editing screen. Be sure to save the page (again, orange “Save” button on upper right-hand side of the screen).
Repeat the steps above if you need to add the block to additional pages.
Step 4: Review and Test on the Front End
Now, let’s make sure that the static block you added looks and behaves as intended. Open a new incognito/private tab in your browser and navigate to the page where the new block is supposed to appear. Is it in the right location? Does it look and behave correctly?
If the answer is “no”, you can edit the block / page until you’re satisfied (repeating relevant steps above).
In addition to the homepage, we also added the new COVID-19 block to the “About Us” page in our test environment:
We’ve all had a healthy dose of curveballs thrown our way over the past several weeks. New experiences, new priorities, and new ways of doing things are becoming the norm, and that’s unsettling. But you’re not alone. If you’re experiencing challenges with your eCommerce operations, let’s talk. We’re in this together – and let’s work through this together.