Hi together,
is it possible to use more than one ancestor in Prototyping with typoscript2?
In yaml-files, there is the supertype-possibilities. So I can combine the fields of different nodeTypes.
In ts2, I can’t find something similar.
I would like to use all properties of two Ancestors. Normally I can do it with good inheritance-logic.
But in the current situation, each Ancestor-prototype-properties has no dependency directly on each other in most of the child-prototypes, there are inherit from one of them. So flowQueries would have problems in other prototypes, if I would write all of them in one Big-Ancestor.
doesn’t work .
I could write an more detailed child-prototype with less abstraction an break apart in ancestors, but so I have to rewrite properties in different prototypes a few times.
Maybe there is a really pretty solution, but I stumble always blindly without finding it. So I have to ask once more:
####Did someone knows a working Neos-solution or a good work-around?
Hi @mficzel,
you are right. There is a huge field to lern better practice for me .
I thought, it would be nice to combine the flowQuery definitions and other logic stuff of both of the protoypes there was written allready. So I do not have to rewrite double property-definition with the same final result only in an other context.
But if there is not such a key/term in Neos, I will write it twice.
Sometimes I did a workaround and later I found an other term. With this and friend google there was suddenly a much simpler solution.
Thanks!
Hey martoro,
once more: Neither I knew this shorthand solution, nor I know the right term/principle to ask for. Thank you!
It works. I get the properties wrapped in a [div]-tag as a string and can use them in the Fluid-Template. Would be great to get the properties one by one.
So, did someone know: is it possible to get the «items» split as properties, like created in the ancestor?
If I try to use a particular property in template like «{items.properyXY}», an error is throwing: $subject must be an object or array, string given.
Could I call the «items = Vendor.Site:CustomFlowQueryPrototype»-part something different, to get the properties from the inherited Prototype as array or object, to use those directly in the Fluid-Tempalte?
The Value the Object TYPO3.TypoScript:Array returns is the concatenated results of all subkeys as a string. That is good for outputting stuff but you cannot access subProperties. If you want do do that TYPO3.TypoScript:RawArray is your friend.
Even though that should work please never do it. That puts a huge amount of data into the context.
Rather than using @context make it a simple property of the CustomNodePrototype and use this to access it.
@mad We had some insightful conversations in Slack, and I even promised to try to document it, but still haven’t found the time so far. Maybe this discussion would help you understand @context a bit better: http://tinyurl.com/typoscript-context