0

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"/>
</container>

expected result

this

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
8

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"/>
    </container>
</referenceContainer>

Then you can remove the before attribute all together.

| improve this answer | |
  • 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
0

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.

or

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

| improve this answer | |
  • 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
0
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.

| improve this answer | |

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.