@dfeyer thanks a lot for [quote=“dfeyer, post:4, topic:1275”]
you can not declare a prototype inside an other prototype, but you can override an existing prototype
[/quote]
Now the next question-mark is gone.
Should be done. if I properly understood and potted it in the topic Overview of General Principle of Prototype.
With study sourceCode, I draw my own flowcharts or found helpful which I extended. At the end I get an image of the rough sequence of code from CMS/Frameworks.
For me, Images helps incredibly more than abstract text.
For Yii, Zendframework, Contao, and (in the early years) for typo3, I could do it in this manner. Because the developers use simple but (at beginning) not less magical-looking code. At the end I got something like: Zend, Yii, WP or this.
Most of the time, I could comprehend the code, or I have to do study to get it. But in Neos with TypoScript-magical «@» also with difficult to grasp «prototype-logic», it is much harder to understand or look in the code, because I can’t follow a tangible code-thread.
So, because I can’t do it for my own like I did before, I hope to find somewhere an Image or something similar for understand what is Neos doing for
- dispatch a request, like in a flow-chart: This I meant with «runtime-order».
bad translation into English I think now
For me it is a big mystery, how the prototype from Typoscript is working. For example:
Why it is not an overkill, to do things like this in prototype-declaration:
##pseudoCode
prototype(Vendor.Site:xyNodeType) < prototype(Content) {
attributes{
id = ${q(node).property('id')}
id.@if.condition = ${q(node).property('id') != '' && q(node).property('id') != null ? true : false}
class = ${q(node).property('class')}
class.@process.addEndInfo = ${value + '-EndInfo'}
class.@if.condition = ${q(node).property('class') != '' && q(node).property('class') != null ? true : false}
}
dataArray = TYPO3.TypoScript:RawArray
dataArray {
when = ${q(node).property('scrollMeOptionWhen')}
when.@if.1 = ${q(node).property('scrollMeOptionWhen') != '' && q(node).property('scrollMeOptionWhen') != null}
from = ${q(node).property('scrollMeOptionFrom')}
from.@if.1 = ${q(node).property('scrollMeOptionFrom') != '' && q(node).property('scrollMeOptionFrom') != null}
to = ${q(node).property('scrollMeOptionTo')}
to.@if.1 = ${q(node).property('scrollMeOptionTo') != '' && q(node).property('scrollMeOptionTo') != null}
...
...
#10 times more like this...
...
}
}
instead of declaration some reusable properties/variables like this:
$id = ${q(node).property('id')}
$class = ${q(node).property('class')}
#or like in js
var id = ${q(node).property('id')}
var class = ${q(node).property('class')}
I can’t find something similar like variables/properties or simple conditional or delete/unset an property in an easy way, like in php/js.
- this means: «missing of reusable variables or properties in the prototype-context (in contrast to php/js)»
So I guess (and hope), the TypoScript-Magic will cache the hole Typoscript and all properties within. And will only execute once and at next dispatch-process it will choose the calculated end-values of the hole TS, like other CMS with something like:
cached-data-exist-and-are-still-valid ? deliver cached-data : createAndCalculate-newCacheOfResultingValue, store it in fileSystem/cacheSystem and deliver the result.
But this is only an hypothesis.
Because I can’t find the particular codeLines nor the particular cache-File or understand at least the underlying logic from TypoScript.
So I try to toddle with a blindfold and guess witch code will be a bit more effektiv, or at least reasonably error-free. But in this manner the comprehension or at least to get an imagination, what I could do with «an other use of», takes much longer (In best case).
- This is why I asked for «the point of execution (when exactely / how often)» for the declared TypoScript-Prototype or Typoscript-Logic in the dispatch-process of Neos.
I hope it would give me a bit more knowledge, without dazzling too. But sometimes, when I stare in the code, the thought appear, «a dark blindfold protects from total blindness».
Nevertheless, I still hope that the TypoScript-magic is not too impossible to comprehend for an average mind - If it will find more and more keys for behind new opening doors.