2

Working with Magento ver. 2.2.2

I wish to change the design of category pages. Now certain categories are displaying only products, But I want to display a static block and products. I create the static block and choose that block in Category|Content, then choose "Static block and products" in display mode. Nothing changes - the store still only displays products with Description, not the block. It works, but is not the look I want. I can create a new category and it displays properly, with the block and products. But I cannot save it with the original URL key, which is necessary, even after changing the key of the original category. I get a duplicate key error.

1

Follow these steps:

  1. Head to backend.
  2. Go to Content tab.
  3. Under Content section, choose static block from Add CMS Block.
  • Thank you Md. Ehsanul Haque Kanan - I have done that but it doesn't change how the category is displayed on the front end. It displays the product only, not the block, even after I have selected the block and told it to display block and product – crabjack Dec 13 '18 at 19:03
1

As you mentioned, for newly created categories, the static block getting displayed whereas for already existing categories it is not displaying right.

Cache might be the reason for the issue.

You can follow the below steps:-

  1. Delete all folders under pub/static
  2. Delete var/cache
  3. Delete var/composer_home
  4. Delete var/generation
  5. Delete var/page_cache
  6. Delete var/view_preprocessed Now open your command prompt and go to your root installation of magento 2 and run the following commands

php bin/magento setup:static-content:deploy

  • Thank you for your answer Prema Karthik. I am fairly new to Magento. Can I delete the folders you mention without losing anything important? – crabjack Dec 13 '18 at 18:12
  • Yes, you can delete. Those files get generated by default. – Prema Karthik Dec 14 '18 at 5:00

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.