1

I am trying to add category description on listing page on under pagination bar. enter image description here

3 Answers 3

3

For a theme that has a parent Magento_Blank you can simply move the element within the layout file Magento_Catalog/layout/catalog_category_view.xml:

<move element="category.description" destination="content" after="-" />

this will tell the block to move in the content container after all the other blocks

1

You can try to move the block in the layout

Add this code to app/design/frontend/<Vendor>/<Theme>/Magento_Catalog/layout/catalog_category_view.xml:

<move element="category.description" destination="content"  after="category.products" />

However, it should work for default luma theme. For custom theme it maybe will not work.

EDIT

Also, you can try to add to this layout next lines:

<referenceContainer name="content">
     <block class="Magento\Catalog\Block\Category\View" name="category.description" template="Magento_Catalog::category/description.phtml" after="category.products" />
</referenceContainer>

Hope this will help.

0

Open this file

app/design/frontend/<Vendor>/<Theme>/Magento_Catalog/layout/catalog_category_view.xml

Find this code:-

<block class="Magento\Catalog\Block\Category\View" name="category.description" template="Magento_Catalog::category/description.phtml" before="-" />

Replace above code with this code:-

<block class="Magento\Catalog\Block\Category\View" name="category.description" template="Magento_Catalog::category/description.phtml" after="category.products" />

After Clear cache and check

4
  • 3
    Please, stop suggesting the use of $objectManager in frontend, that is a HUGE NO-NO!!!!
    – Vlad Patru
    Commented Mar 15, 2018 at 7:00
  • @VladPatru, I have changed the code, thank you Commented Mar 15, 2018 at 12:41
  • You should use the move like I posted above, you shouldnt have the block redeclared in your theme since it is already in the Magento default
    – Vlad Patru
    Commented Mar 15, 2018 at 12:55
  • This one working more convenient Commented Mar 15, 2018 at 13:00

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.