How do I add a CMS Static Block Text Box To All Product Listings In Magento?

by Shahrooz   Last Updated May 15, 2018 20:09 PM

I would like to display a CMS Static Block text box at the bottom of all product listings in Magento, but I would need the code to put in CMS -> Static Blocks in the admin panel in order to do so. Any help would be appreciated, thank you.

Answers 2

You need a custom theme or a module to do this. In the case of a theme, create the following file:


WIth the following content:

<?xml version="1.0"?>
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
<page xmlns:xsi="" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <referenceContainer name="content">
      <block class="Magento\Cms\Block\Block" name="yourblockname">
          <argument name="block_id" xsi:type="string">id_defined_in_block_admin</argument>

Your block will then appear at the bottom of all product listing (category) pages.

May 15, 2018 22:39 PM

you can add code in your list.phtml from your theme(template\catalog\product).

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('block_identifier')->toHtml(); 
May 16, 2018 05:34 AM

Related Questions

Why changes in a CMS block doesn't appear?

Updated May 31, 2017 12:09 PM

Trying to add a Block to allowed blocks - white page

Updated October 13, 2017 15:09 PM

Magento 2.1.9 CMS Block massdelete action gives error

Updated November 07, 2017 11:09 AM