Bug #54377

Using an array for classes in content elements is not possible by default

Added by Christopher Hlubek almost 6 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Start date:
2013-12-13
Due date:
% Done:

0%


Description

Writing something like this in the TypoScript for a custom node type should be possible:

attributes.class = TYPO3.TypoScript:RawArray
attributes.class.foo = 'bar'

Right now it causes problems with the processor that is applied to the class attribute in prototype(TYPO3.Neos:Content).attributes.class because the value of the attribute is treated only as a string, which gives an "Array to string conversion exception".

It should be possible to do so by making the expression for the class generation more robust.

History

#1 Updated by Bastian Waidelich almost 6 years ago

Christopher Hlubek wrote:

It should be possible to do so by making the expression for the class generation more robust.

+1

It is currently

prototype(TYPO3.Neos:Content) < prototype(TYPO3.TypoScript:Template) {
    attributes = TYPO3.TypoScript:Attributes
    attributes.class = ''
    attributes.class.@process.nodeType = ${String.trim(value + ' ' + String.toLowerCase(String.pregReplace(q(node).property('_nodeType.name'), '/[[:^alnum:]]/', '-')))}
}

We should probably encapsulate this to an Eel-Helper that also accepts arrays

#2 Updated by Daniel Lienert about 5 years ago

  • Assignee set to Daniel Lienert

#3 Updated by Daniel Lienert about 5 years ago

  • Status changed from New to Closed

Also available in: Atom PDF