In Root.ts2
, I have a line such as this:
content = ${q(node).property('some-property').trim()}
The line works when I leave out the .trim()
at the end. When I include it, I get an exception with message: “An exception was thrown while Neos tried to render your page. Method "trim" is not callable in untrusted context”.
The Neos documentation does not even contain the words “trusted” or “untrusted”, so I have no idea what is the cause, and why this is regarded as untrusted.
Any ideas?
You can use Eel helpers in TS2. String helper - TYPO3.Eel/Classes/TYPO3/Eel/Helper/StringHelper.php
- has trim method which can be used like that:
content = ${String.trim(q(node).property('some-property'))}
This might be also helpful - https://learn-neos.com/blog/hitchhikers-guide-to-typoscript-2-part1.html