Bug #54377
Using an array for classes in content elements is not possible by default
Status: | Closed | Start date: | 2013-12-13 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | Daniel Lienert | % Done: | 0% |
|
Category: | - | |||
Target version: | Base Distribution - 1.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 over 1 year 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 10 months ago
- Assigned To set to Daniel Lienert
#3 Updated by Daniel Lienert 10 months ago
- Status changed from New to Closed
Moved to Jira: https://jira.typo3.org/browse/NEOS-513