2016-12-05 15 views
-1

現在のページの2番目のフォールバックオプションを作成しようとしました。 現在の関数は、列が空の場合、親ページの内容を取得します。しかし、フォールバックも空であればオプションも必要です。 フォールバックも空でなければならない場合は、次のレベル(leveluid:-3)に移動する必要があります。2番目のifEmpty条件

typoscriptでこの問題を処理するソリューションはありますか?

variables.element = CONTENT 
variables.element { 
    table = tt_content 
    select { 
    pidInList.data = page:uid 
    orderBy = sorting 
    where = colPos=3 
    } 
    # Fallback 
    stdWrap.ifEmpty.cObject = CONTENT 
    stdWrap.ifEmpty.cObject { 
    table = tt_content 
    select { 
     pidInList.data = leveluid:-2 
     orderBy = sorting 
     where = colPos=3 
    } 
    } 
    # Fallback 2 
    stdWrap.ifEmpty.cObject = CONTENT 
    stdWrap.ifEmpty.cObject { 
    table = tt_content 
    select { 
     pidInList.data = leveluid:-3 
     orderBy = sorting 
     where = colPos=3 
    } 
    } 
} 

答えて

4

なぜそれほど複雑ですか?

CSCまたはFSCを使用すると、メイン列(colPos = 0)からコンテンツレコードを収集するためにstyles.content.getが定義されます。

variables.element < styles.content.get 
variables.element.select.where = colPos = 3 
variables.element.slide = -1 
(CONTENTのドキュメントを参照してください) slide

これは、他の列に高めることが容易で、上記のページからコンテンツを収集するための簡単なメカニズムがあります

関連する問題