Making a ContentCollection editable

Hi,

I try to make a simple content element (SuperType=Content), containing two ContentCollections. One to hold content for our logged in users, and one with alternative content.

'Eg.Website:MemberContent':
  ui:
    label: 'Mitglieder-Info'
    #icon: 'icon-bullhorn'
    icon: 'icon-info'
    help:
     message: 'Unterschiedliche Inhalte für Mitglieder und Nichtmitglieder.'
  superTypes:
    'TYPO3.Neos:Content': TRUE
  childNodes:
    member-content:
      type: 'TYPO3.Neos:ContentCollection'
    alternative-content:
      type: 'TYPO3.Neos:ContentCollection'


prototype(Eg.Website:MemberContent) < prototype(TYPO3.Neos:Content) {

	templatePath		= 'resource://Eg.Website/Private/Templates/NodeTypes/MemberContent.html'

	member-content 		= ContentCollection {
		#nodePath 		= 'member-content'
		nodePath 		= ${q(node).find('member-content').property('_path')}
		collection 		= ${q(node).find('member-content').children()}
	}

	alternative-content = ContentCollection {
		nodePath 		= ${q(node).find('alternative-content').property('_path')}
		collection 		= ${q(node).find('alternative-content').children()}
	}

	attributes.class	= 'member-content'
}



{namespace neos=TYPO3\Neos\ViewHelpers}
{namespace ts=TYPO3\TypoScript\ViewHelpers}

<div{attributes -> f:format.raw()}>

	<h3>Member</h3>
		{member-content -> f:format.raw()}
	<h3>Alternative</h3>
		{alternative-content -> f:format.raw()}

</div>

In backend the content element is selectable, but not its inner CCs. But:
One can select the CCs from the structure tree and even put elements within them.

With the browser tools I dicovered, the following classes in the class atrribute of the element:

class=neos-contentelement neos-not-inline-editable member-content eg-website-membercontent neos-contentelement-active

If I disable the surrounding Tag:

<div id="ember1264" class="ember-view neos-contentelement-overlay __web-inspector-hide-shortcut__" style="width: 732px; height: 211px;"><span></span></div>

I’m able to access the inner CCs and the Elements within them, if I hide this div, using the browswer tools.

The big question:
What has to be done to make a ContentColletion editable within a ContentElement?

Regards Klaus

Hi Klaus,

you might need to add inlineEditable to your yaml config, like this:

'Eg.ContentElements:ContentWrapper':
  superTypes:
    'TYPO3.Neos:Content': TRUE
  childNodes:
   contentItems:
     type: 'TYPO3.Neos:ContentCollection'
  ui:
    group: 'general'
    label: i18n
    inlineEditable: TRUE

but maybe it would be better to use something like this package to control user content:

1 Like

Thanks Christian!

Works.

ui:
    inlineEditable: TRUE

has to be given.