1

I created a CMS Page, where I included a ".phtml" file with block-->Widget.

On that CMS Page, I only have that ".phtml" file pulling in and no other content at all.

Now there is a blank "column main" div on that CMS page. How can I remove this?

The "Column main" shouldn't even be there, if there is no content in it..

enter image description here

7
  • why do you want remove column-main ? You can hide it by css in case empty content
    – mrtuvn
    Apr 29, 2017 at 2:27
  • Yea I could hide it with ":empty" but, the problem is column-main always has content even if its "empty" there is an "display:none; div inside and a hidden input.. What should I do to hide it?
    – N1njaWTF
    Apr 29, 2017 at 9:19
  • U can remove using jQuery javascript in ur .phtml file if u want
    – Jackson
    May 8, 2017 at 3:17
  • Hmm.. Isnt there a better maybe full css solution? But how would it work with jquer js? :)
    – N1njaWTF
    May 8, 2017 at 6:10
  • how does your page content look like
    – Marius
    May 10, 2017 at 6:50

2 Answers 2

0

You should not remove that div because it has form_key hidden input inside. If you remove this, your add to cart and login might not work for this page. Magento does not validate post request without a form key. What's the problem with display:none for main content of cms page. Just do it with precision so nothing else overridden it

5
  • How can I do "display:none" ONLY for that home-page? Looks like the column main is in "1 column" layout. So in my ".phtml" file I cannot make "display:none;" since that div is not coming from there. The blank column main div is coming from layout "1 column"..
    – N1njaWTF
    May 11, 2017 at 9:58
  • Add a body class to your cms page only. Refer this magento.stackexchange.com/a/104065/40851 May 11, 2017 at 10:49
  • I dont understand. I have a "blank" cms page which has "1 column" as its layout. then I have a block which includes the "homepage.phtml" file and display options as 1 column and show on cms home page.
    – N1njaWTF
    May 11, 2017 at 11:08
  • Paste your layout in your question May 11, 2017 at 11:28
  • I use the default "column1" layout currently. But i do not have any content on the site and only a block (.phtml page), thats why there is a blank div "column main" from that layout "column1".
    – N1njaWTF
    May 11, 2017 at 13:42
0

If you go back into your CMS page editor and view the HTML, can you see this div?

If not is this div inside the .phtml file you are including?

If not, check the page template/design you are using for that page such (e.g. 1 column) and take a look in that template file as it may be a wrapper in that template which is obviously outside your editable code in the CMS page.

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.