Let's say I want to remove the page-wrapper css class from the page.wrapper container. How would I do that? I know that I can add additional attributes or change existing attributes this way in the default.xml of my theme or module:

<referenceContainer name="page.wrapper" htmlId="wrapper" htmlClass="foo" />

Just using htmlClass="" does not work. Magento will complain that this is an invalid value.

  • Why would it need to be empty? What about a class-name that is known not to be used? htmlClass="certainlynotfoo" - Not trying to sound malicious but no need for it to be removed, if it can just be changed =) – MackieeE Feb 8 '18 at 15:09
  • Sure, it can be changed to anything. But I would still want to know if and how existing attributes can be removed. – fritzmg Feb 8 '18 at 15:14
  • I do apologise, I confess I skimmed over the first paragraph :X Having done a little research on this since (I don't know the answer to your question, much to the labyrinth that is Magento); There doesn't seem to have a native method to do this it seems. It would be OTT to remove=.. the tag entirely & include it back in without the htmlClass too. – MackieeE Feb 8 '18 at 16:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.