Prevent divs wrapping for contentcollections / change their css classes

Hi,

I’m trying to get rid of the default wrapping div containers which are created using the built in prototypes. There is already a discussion about that here which helps a lot, but I couldn’t find out how to remove the <div class="neos-contentcollection"> wrappers for contentcollection nodes. How do I overwrite the output of contentcollections?

Hi,

I found a way for childNodes of type ContentCollection

page = Page {
  body {
    // These are your content areas, you can define as many as you want, just name them and the nodePath.
    content {
      // The default content section
      main = PrimaryContent {
        nodePath = 'main'
      }
      // A footer ContentCollection
      footer = ContentCollection {
        nodePath = 'footer'
        // prevent adding default css class .neos-contentcollection
        attributes.class.@process.collectionClass >
        // add custom css classes
        attributes.class = 'ui fluid container'
      }
    }
  }
}

For main – the PrimaryContent – it is a bit more complicated, since PrimaryContent is of type TYPO3.TypoScript:Case

In order to change the css classes for every page:

prototype(TYPO3.Neos:PrimaryContent) {
  default.renderer {
    attributes.class = 'main-content'
    attributes.class.@process.collectionClass >
  }
}

In order to change the css classes for a specific node type

prototype(TYPO3.Neos:PrimaryContent) {
  // add a new case definition for your page
  mypage {
    condition = ${q(node).is('[instanceof My.Package:MyPage]')}
    renderer = TYPO3.Neos:ContentCollection {
      nodePath = ${nodePath}
      attributes.class = 'my-css another-class'
      attributes.class.@process.collectionClass >
    }
  }
}

Is there another – shorter way to modify the css classes of PrimaryContent?

Maybe this helps someone. Code could contain typos, etc, since I copied and shortened it.

Modifying the css classes of the wrapping divs is helpful, but is there a way to prevent the output of wrapping divs at all?