[Neos] Custom two-column content element

Daniel Lange mail at lange-daniel.se
Sun Jun 8 21:44:32 CEST 2014


Hi,

I'm just getting started with NEOS and have unfortunately run into some problems. 

I'm trying to create a custom element with two columns (with the possibility to add additional content elements to each of the columns individually  e.g. headline, text etc.). 

Everything works fine as long as I only have one column, but as soon as I add the second one the page just turns blank and nothing can be added anymore.

The following code (one column) is fully functional:
NodeTypes.yaml:
'Daniel.MultiColumn:TwoCol':
  superTypes:
    - 'TYPO3.Neos:Content'
  ui:
    label: 'Two-Column (50/50)'
    group: structure
    icon: 'icon-edit'
    inlineEditable: TRUE
  childNodes:
    content:
      type: 'TYPO3.Neos:ContentCollection'

Root.ts2
prototype(Daniel.MultiColumn:TwoCol) < prototype(TYPO3.Neos:Content)
prototype(Daniel.MultiColumn:TwoCol) {
	templatePath = 'resource://Daniel.MultiColumn/Private/Templates/TypoScriptObjects/twocol.html'
	contentContainerLeft = TYPO3.Neos:ContentCollection
	contentContainerLeft {
		nodePath = 'content'
	}
}

twocol.html
{namespace ts=TYPO3\TypoScript\ViewHelpers}
{namespace neos=TYPO3\Neos\ViewHelpers}
<div class="col1"><ts:render path="contentContainerLeft" /></div>
<div class="col2">Lorem ipsum</div>

However, as soon as I adjust it to cater for two columns (see below code), nothing works anymore. 
NodeTypes.yaml:
'Daniel.MultiColumn:TwoCol':
  superTypes:
    - 'TYPO3.Neos:Content'
  ui:
    label: 'Two-Column (50/50)'
    group: structure
    icon: 'icon-edit'
    inlineEditable: TRUE
  childNodes:
    content:
      type: 'TYPO3.Neos:ContentCollection'
    content2:
      type: 'TYPO3.Neos:ContentCollection'

Root.ts2
prototype(Daniel.MultiColumn:TwoCol) < prototype(TYPO3.Neos:Content)
prototype(Daniel.MultiColumn:TwoCol) {
	templatePath = 'resource://Daniel.MultiColumn/Private/Templates/TypoScriptObjects/twocol.html'
	contentContainerLeft = TYPO3.Neos:ContentCollection
	contentContainerLeft {
		nodePath = 'content'
	}
	contentContainerRight = TYPO3.Neos:ContentCollection
	contentContainerRight {
		nodePath = 'content2'
	}
}

twocol.html
{namespace ts=TYPO3\TypoScript\ViewHelpers}
{namespace neos=TYPO3\Neos\ViewHelpers}
<div class="col1"><ts:render path="contentContainerLeft" /></div>
<div class="col2"><ts:render path="contentContainerRight" /></div>

Has anybody tried to accomplish something similar or knows how to solve this? I know that Neos is shipped with a multi-column content element, but in this case I would like to build my own content element. 

Best,
Daniel


More information about the Neos mailing list