I'm going completely mad here. I have the following in "Layout Update XML" in one of my categories:

<referenceContainer name="content">
    <block class="Us\Tastemakers\Block\Tastemakers" name="category.tastemakers" template="Us_Tastemakers::tastemakers.phtml" before="-"/>

I then have the following files:


namespace Us\Tastemakers\Block;
class Tastemakers extends \Magento\Framework\View\Element\Template
    protected $_productCollectionFactory;

    public function __construct(
        \Magento\Backend\Block\Template\Context $context,        
        \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,        
        array $data = []
        $this->_productCollectionFactory = $productCollectionFactory;    
        parent::__construct($context, $data);

    public function getProductCollection()
        $collection = $this->_productCollectionFactory->create();
        $collection->setPageSize(3); // fetching only 3 products
        return $collection;

And app/code/Us/Tastemakers/view/frontend/templates/tastemakers.phtml


/* *
 * @var \Us\Tastemakers\Block\Tastemakers $block

 echo 'Hi there. I\'m here. I\'m a tastemaker';

// $productCollection = $block->getProductCollection();
// foreach ($productCollection as $product) {
//     echo "Inside view <pre>";
//     print_r($product->getData());
//     echo "</pre><br>";
// }

But none of my text gets displayed anywhere. I have done a complete cache:flush for good measure.

I'm completely going mad here. I must be missing something. Please put me out of my misery!


I have the impression that something is stopping the admin's layout update xml from doing anything at all:

I have now added the same XML block to the catalog_category_view.xml and it works fine.

However, no layout update xml in the admin backend have any effect.

Here are two I have tried:

<referenceContainer name="content">
            <referenceBlock name="category.tastemakers">
                    <argument name="skus" xsi:type="string">1,2,3</argument>
<referenceContainer name="content">
        <referenceBlock name="category.tastemakers"  remove="true"/>

It literally doesn't do anything.

1 Answer 1


Remove the before="-" and see if it works.

Or check on the web page source in case it's putting the text somewhere on the page.

  • Thanks for taking the time to answer @kibret. It seems to me to be a more general problem with the Admin's Update Layout XML: I have since added this to the layout's XML files, and it works fine. It does however appear that none of the changes I attempt to make through the admin's update layout xml have any effect whatsoever. Have a look at my edit above.
    – nanos
    Sep 11, 2019 at 10:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.