0

I have created a block in the backend of Magento and using the below code added it to the category page-

<page>
 <body>
    <referenceBlock name="page.main.title" remove="true"/>
    <referenceBlock name="category.description" remove="true"/>
    <referenceContainer name="sidebar.main">
        <block class="Magento\Cms\Block\Block" name="filteredby">
            <arguments>
                <argument name="block_id" xsi:type="string">filteredby</argument>
            </arguments>
        </block>
    </referenceContainer>
</body>
</page>

The image shows up, but it shows up at the bottom of the container. So I tried moving it in that file with this code-

<move element="filteredby" destination="sidebar.main" before="-"/>

and it didn't work. So I tried the same code in my default.xml and in my catalog_category_view_type_layered.xml. I cleared the cache everytime after I made the change and still nothing. Am I not placing the code in the correct place or is the code wrong?

0

You Can try this one :

<referenceContainer name="sidebar.main">
        <block class="Magento\Cms\Block\Block" name="filteredby">
            <arguments>
                <argument name="block_id" xsi:type="string">filteredby</argument>
            </arguments>
        </block>
 </referenceContainer>
 <move element="catalog.leftnav" destination="sidebar.main" after="filteredby"/>
  • Still no go, but I found the answer. Thanks for the attempt though. – tjjen May 11 '18 at 16:33
  • I have tried and it's working fine, I think there is some another issue. – hweb87 May 14 '18 at 8:46
0

I was not able to get the block to move. I was using the wrong template. I was using the one from blank, not Luma. Once I switched those I was able to just insert the image at the top of the layered navigation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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