I have add one block in product detail page. I am trying to position the block before footer but its not work.

<container name="chennai.review" htmlTag="div" htmlClass="review" before="footer-container">
<block class="Gworks\About\Block\Review" name="chennai.review.info" template="Gworks_About::review.phtml"/>

expected result


why my code is not working,How to achieve?

  • Is it injecting the contents of that container anywhere on the page? Just in the wrong location? – Tyler Craft Apr 5 '16 at 18:57
  • sorry I can't get clear, could you explain more – Bilal Usean Apr 5 '16 at 19:17

One possible solution to your issue:

Instead of using the before attribute on your new container (I have not seen the most consistent results using this), Just add your new container node inside the page.bottom.container container.

This should look something like:

<referenceContainer name="page.bottom.container">
    <container name="chennai.review" htmlTag="div" htmlClass="review">
        <block class="Gworks\About\Block\Review" name="chennai.review.info" template="Gworks_About::review.phtml"/>

Then you can remove the before attribute all together.

  • Thanks for the reply. your code working after put some css work! first its look like strange. I am looking for reason why before attribute not working for me, if you update, tick your answer. now upvote you :-) – Bilal Usean Apr 5 '16 at 19:15

Delete the contents of <your Magento install dir>/pub/static folder.

Run the static view files deployment tool <your Magento install dir>/bin/magento setup:static-content:deploy.


Run the below command:

<your Magento install dir>php bin/magento setup:static-content:deploy    
<your Magento install dir>php bin/magento indexer:reindex
<your Magento install dir>php bin/magento cache:flush

May that solve your problem

  • before itself I try this no luck, are you sure my method is right? because position only the problem, contents get reflecting successfully – Bilal Usean Apr 5 '16 at 18:53
remove any folder from <your Magento install dir>/var/cache/
remove **view_preprocessed** folder from <your Magento install dir>/var/
remove all folder (frontend) rom <your Magento install dir>/pub/static/

Now refresh the page, your changes will be there, otherwise there is some problem in your code.

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.