私は最初の部分を作成してレンダリングしようとします。最初に "TableRow.html"というファイルを作成しました。部分がレンダリングされていません
それから私は、テスト目的のために別名マップを作成しました。全体コード:
<f:layout name="Default" />
This Template is responsible for creating a table of domain objects.
If you modify this template, do not forget to change the overwrite settings
in /Configuration/ExtensionBuilder/settings.yaml:
Resources:
Private:
Templates:
List.html: keep
Otherwise your changes will be overwritten the next time you save the extension in the extension builder
<f:section name="main">
<table class="tx_troubleshooterv3" >
<tr><td>Test</td></tr>
<f:alias
map="{
masterpagez:
{
0: {
infotext: 'This is the main page.',
questions:
{
0: {
question: 'Main Question A1',
pages:
{
infotext: 'Answer A1',
questions:
{
0: {
question: 'Question B1'
pages: {
infotext: 'Answer B1',
questions:
{
0: {
question: 'Question C1',
pages: {
infotext: 'Answer C1',
questions: NULL
}
}
}
}
}
1: {
question: 'Question B2'
pages: {
infotext: 'Answer B2',
questions: NULL
}
}
}
}
},
1: {
question: 'Main Question A2',
pages:
{
infotext: 'Answer A2',
questions:
{
0: {
question: 'Question B2',
pages: {
infotext: 'Answer B2',
questions: NULL
}
}
}
}
}
}
}
}
}"
>
<f:for each="{masterpagez}" as="masterpage">
<f:for each='{masterpage.questions}' as="qquestion">
<f:for each='{qquestion.pages}' as='page'>
<f:render partial="TableRow" arguments="{page: page}"/>
</f:for>
</f:for>
</f:for>
</f:alias>
ご覧のとおり、最初の2つの質問のページを私の部分ファイルに渡してみます。
TableRow.html
しかし、私は出力のみ「テスト」と他には何を得る:その後、私はちょうど私の部分では、これらのページの情報テキストをレンダリングしてみてください。 なぜ私の部分はレンダリングされませんか?
予想される出力:(HTMLなど)
回答A1
回答B2
出力:
更新: 変数 "page"をデバッグしましたが、期待したように2つではなく4つのデバッグボックスが表示されましたか?誰かがこれを説明できますか?