2

I try to add a new block in the category_view.xml for the footer sesion I don't see my new block any idea?

  <referenceContainer name="footer-container">
        <block class="Magento\Framework\View\Element\Template" template="category/banner_category_footer.phtml" name="banner_category_ptk"/>
    </referenceContainer>

Above code is placed in app/design/frontend/Special/cali/Magento_Catalog/layout/catalog_category_view.xml

and the file template is

app/design/frontend/Special/cali/Magento_Catalog/templates/category/banner_category_footer.phtml

2 Answers 2

1

Try moving catalog_category_view.xml to:

app/code/Special/cali/view/frontend/layout/catalog_category_view.xml

and banner_category_footer.phtml to:

app/code/Special/cali/view/frontend/templates/category/banner_category_footer.phtml

Re-compile & re-deploy your site.

php -d memory_limit=1024M bin/magento setup:di:compile
rm -rf var/di var/generation/* var/view_preprocessed pub/static/*
php bin/magento setup:static-content:deploy
1
1

Just Update as per following:

<referenceContainer name="footer-container">
        <block class="Magento\Framework\View\Element\Template" template="Magento_Catalog::category/banner_category_footer.phtml" name="banner_category_ptk"/>
</referenceContainer>
6
  • Hi @Salma its working fine for foolter but i wants to add after category product title. Dec 2, 2018 at 14:35
  • Just add in as follows <referenceContainer name="columns.top"> <block class="Magento\Framework\View\Element\Template" template="Magento_Catalog::category/banner_category_footer.phtml" name="banner_category_ptk" before="page.main.title"/> </referenceContainer> Dec 5, 2018 at 9:35
  • @SalmaSaiyad, will it load after category products? Jan 9, 2019 at 9:42
  • @shivashankarm. i need to move after category products, before the footer Jan 9, 2019 at 9:45
  • <referenceContainer name="category.view.content"> <block class="Vendor\Module\Block\Category" name="category.view.reward" template="Vendor_Module::category/form.phtml" after="content"> </block> </referenceContainer> Jan 9, 2019 at 10:17

Your Answer

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

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