Typoscript DatabaseQueryProcessor-如果字段为空则滑动

时间:2019-02-27 07:52:23

标签: typo3 typo3-9.x

我的页面设置中有一个mm关系字段。

$myext_pages_fields = array(
    'tx_myext_topofferitem' => Array(
        'label' => 'Relation',
        'config' => Array(
            'type' => 'group',
            'internal_type' => 'db',
            'allowed' => 'tx_myext_topofferitem',
            'MM' => 'tt_content_tx_topofferitem_mm',
            'size' => '20',
            'maxitems' => '99',
            'show_thumbs' => '1',
            'suggestOptions' => [
                'default' => [
                    'searchWholePhrase' => 1
                ],
                'pages' => [
                    'searchCondition' => 'doktype = 1'
                ]
            ],
        )
    ),
);

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('pages', $myext_pages_fields);

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages', '--div--;Top Offers,tx_myext_topofferitem');

如果该字段为空,则应提供下一个填充的根线页面的项目。

要获得这些项目,我可以像这样使用DatabaseQueryProcessor。

page = PAGE
page {
  10 = FLUIDTEMPLATE
  10 {
    200 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
    200 {
      table = tx_myext_topofferitem
      pidInList = root,-1
      recursive = 99
      selectFields = tx_myext_topofferitem.*
      join = tt_content_tx_topofferitem_mm ON tt_content_tx_topofferitem_mm.uid_foreign = tx_myext_topofferitem.uid
      where.data = field:uid
      where.intval = 1
      where.wrap = tt_content_tx_topofferitem_mm.uid_local=|
      orderBy = tt_content_tx_topofferitem_mm.sorting
      as = tx_myext_topofferitem_items
    }
  }
}

我尝试将其用作where.data,但这不起作用。

levelfield : -1 , uid, slide

(TYPO3 9LTS)

1 个答案:

答案 0 :(得分:1)

在这里似乎最好使用嵌套数据处理。因此,首先获取rootline菜单,然后获取属于该菜单特定页面的项目。

y