To reference a container you need to use referenceContainer
as opposite to referenceBlock
to reference a block.
The container
tag is used to create a container as the block
tag is used to create a block.
In your case, the right code would be:
<referenceContainer name="sidebar.additional">
<block class="Magento\Cms\Block\Block" name="test">
<arguments>
<argument name="block_id" xsi:type="string">test</argument>
</arguments>
</block>
</referenceContainer>
This is assuming your cms block id is test
, you'll need to replace that value in case it is different
Neither your directory setup nor your code is wrong, the thing is there is no possibility to extend this configuration <page layout="..."
on the theme level for now, this possibility may be added in upcoming releases.
So if you want to set 2columns-left
layout you need to set it for all pages seperately, what I meant to say is:
For Homepage you need to dive into your admin and select the CMS page which is being displayed on the homepage and open Design tab and select your desired layout.Screenshot will be attached
For Category page you have two options to set your desired layout, one is either you dive into admin and set layout from Design tab, but in that case you need to manually set design for each and every category and the other quicker way is that you create a new catalog_category_view.xml file at below path:
\Metal
\bronze
\Magento_Catalog
\layout
catalog_category_view.xml
with the code:
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body/> </page>
Remember to flush your cache, if your cache is enabled from the admin panel. And you will be getting expected output.
Similarly, you can set your desired layout for any page by targeting the xml file, for ex: catalog_product_view.xml in case of product detail page.
And if you are in dilemma, that for setting your desired layout for CMS homepage why we preferred to set up the layout from the admin panel rather then doing changes in the xml file, like we did for category and product then do let me know. Will clearify it for you.
Hope this helps you. If it does, then kindly upvote it. Thanks
Best Answer
Goto Admin panel
Click on your category then goto
Display Setting
Tabnow you'll set filter options in left side bar.
If you not get the filter,
in admin panel category edit check
Custom design
Tabset page layout as
2columns-left.phmtl or 3columns.phtml
or check your catalog.xml file in that make sure the category view page template is
2columns-left.phmtl or 3columns.phtml