3

これが私がやりたいことです: 特定のページで、特定のページの最初の子ページのすべてのコンテンツ要素を表示したいと考えています。サブページのコンテンツ要素の後に他のコンテンツ要素を表示する必要があるため、単純にショートカット ページを使用することはできません。これどうやってするの?

これは私ができると思う方法のスニペットですが、選択を構築する方法がわかりません。より良い方法はありますか?

# save current content
tmp.pagecontent < page.10.subparts.main-content

# clear the content of the main column
page.10.subparts.main-content >

# build a new object for this column as content-object-array
page.10.subparts.main-content = COA
page.10.subparts.main-content {
  10 = CONTENT
  10.table = tt_content
  10.select {
    # what should I put here?
  }
# re-insert the normal pagecontent to the page  
20 < tmp.pagecontent
4

2 に答える 2

3

他の人への回答を追加するだけです。First : 現在のページの最初のサブページを指定します。2 番目: そのサブページに必要なコンテンツ要素を取得します。

temp.content = COA
temp.content {
  10 = CONTENT
  10 {
    table = pages
    select {
      pidInList.field = uid
      orderBy = sorting ASC
      max = 1
      begin = 0
    }
    renderObj = COA
    renderObj {
      10 = CONTENT
      10 {
        table = tt_content
        select {
          languageField = sys_language_uid
          pidInList.field = uid
          orderBy = sorting
          #where = colPos = 10
        }
        stdWrap.wrap = |
      }
    }
  }
}
于 2013-06-14T04:04:54.943 に答える
-1

やっと成功!それが最善の方法であるかどうかはわかりません。あなたはそれについてどう思いますか?2 番目の選択も userFunc に入れる必要がありますか?

ファイル管理者/userfunc/mailArchive.php

<?php
class user_mailArchive {
    function getFirstChild($content, $conf) {
        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
                'uid',                         // SELECT ...
                'pages',                       // FROM ...
                'pid='.intval($conf['pid']),   // WHERE...
                '',                            // GROUP BY...
                'sorting',                     // ORDER BY...
                '1'                            // LIMIT ...
            );
        $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
        if ($row) {
            return $row['uid'];
        }
        else {
            return '';
        }
    }
}

TS テンプレート

# fill the content of the main-column to a tmp.object
tmp.pagecontent < page.10.subparts.main-content

# clear the content of the main column
page.10.subparts.main-content >

includeLibs.mailArchive= fileadmin/userfunc/mailArchive.php

# build a new object for this column as content-object-array
page.10.subparts.main-content = COA
page.10.subparts.main-content {
  10 = CONTENT
  10 {
    table = tt_content
    select {
      pidInList.cObject = USER
      pidInList.cObject {
        userFunc = user_mailArchive->getFirstChild
        # parent page ID
        pid = 139
      }
      orderBy = sorting
    }
  }

# re-insert the normal pagecontent to the page  
  20 < tmp.pagecontent
}
于 2011-06-17T15:53:01.307 に答える