0

プロジェクト用の Lelesys.Plugin.SlideShow プラグインをダウンロードしました。これにより、2 つの NodeType プロトタイプが導入されます。

prototype(Lelesys.Plugin.SlideShow:SlideShowContainer) < prototype(TYPO3.Neos:Content)
prototype(Lelesys.Plugin.SlideShow:SlideShowContainer) {
  templatePath = 'resource://Lelesys.Plugin.SlideShow/Private/Templates/TypoScript/SlideShowContainer.html'
  slideShowContainerCollection = ${q(node).children('slideShowContainer').children('[instanceof TYPO3.Neos.NodeTypes:Image]')}
  slideShowContainerItemCollection = TYPO3.Neos:ContentCollection
  slideShowContainerItemCollection {
    nodePath = 'slideShowContainer'
  }
  properties = ${node.properties}
}

prototype(Lelesys.Plugin.SlideShow:SlideShowItem) < prototype(TYPO3.Neos.NodeTypes:Image)
prototype(Lelesys.Plugin.SlideShow:SlideShowItem) {
  templatePath = 'resource://Lelesys.Plugin.SlideShow/Private/Templates/TypoScript/SlideShowItem.html'
  slideShowContainerProperty = ${q(node).property('_parent.parent.properties')}
  sliderImageTitle = ${q(node).property('sliderImageTitle')}
  sliderImageDescription = ${q(node).property('sliderImageDescription')}
}

ご覧のとおり、事前定義されたテンプレートが付属しています。私はそれを自分のものと交換しました。SlideShowContainer のテンプレートでは、おおよそ次のような状況になっています。

<f:if condition="{slideShowContainerCollection -> f:count()}>1">
  <f:then>
    <f:for each="{slideShowContainerCollection}" as="slideitem" iteration="slideitemIterator">
      <media:image image="{slideitem.properties.image}" alt="test" />

これは、TYPO3.Neos.NodeTypes:Image から継承する SlideShowItem 内の画像をレンダリングするために TYPO3.Media ImageViewHelper を使用するために、私が今までになんとかした最善の方法です。

通常の実装は次のとおりです。

{slideShowContainerItemCollection -> f:format.raw()}

これは基本的に、Neos から ContentCollection を取得し、SlideShowItem のテンプレートを使用して完全にレンダリングします。

ここで、SlideShowItem ノード タイプは既にテンプレートに関連付けられているため、構成されたテンプレートを自動的に考慮して、単純なコマンドで SlideShowItem ノードをレンダリングする簡単な方法が必要であると考えます。何かのようなもの:

<f:render node="{slideitem}">

これは私の想像にすぎませんが、Neos がノードのコレクション全体の出力を自動的に生成するのが非常に簡単な場合、単一のノードをレンダリングする方法があるはずです。

ノード システムと Fluid エンジンに関する私の理解は、まったくの初心者です。私が欲しいものに最も近いものは何ですか?

4

1 に答える 1

0

完全にはわかりませんが、次のTypoScriptでこれを達成できると思います

myRenderingOfAnItem = Lelesys.Plugin.SlideShow:SlideShowItem {
  //Custom modifications for you rendering
}

f:for ループ内で ts:render viewHelper を使用します

<ts:render path="myRenderingOfAnItem" context="{node: slideItem}" />

Fluid テンプレートに ts 名前空間をインポートすることを忘れないでください

{namespace ts=TYPO3\TypoScript\ViewHelpers}
于 2015-09-19T13:19:26.030 に答える