在tx_news记录的详细信息视图中,我遍历所选类别,如果记录具有某个类别(在本例中为uid = 5),则使用定义的uid加载已过滤的列表视图(相关记录)。如果选择了多个类别,它也会起作用,但只有当所选的其他类别具有更高的排序时才会起作用。值。我错过了什么?那是我的设置:
新闻/ Detail.html
...
<!-- check category -->
<f:if condition="{newsItem.categories}">
<f:for each="{newsItem.categories}" as="category">
<f:if condition="{category.uid} == 5">
<f:then>
<f:cObject typoscriptObjectPath="lib.newsslider" />
</f:then>
</f:if>
</f:for>
</f:if>
...
Typoscript:
lib.newsslider = USER
lib.newsslider {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
extensionName = News
pluginName = Pi1
vendorName = GeorgRinger
switchableControllerActions {
News {
1 = list
}
}
settings < plugin.tx_news.settings
settings {
categories = 5
categoryConjunction = and
includeSubCategories =1
limit = 30
detailPid = 97
overrideFlexformSettingsIfEmpty := addToList(detailPid)
startingpoint = 96
templateLayout = 4
hidePagination = 1
list{
paginate {
itemsPerPage = 9
insertAbove =
}
}
}
}
如果所选的其他类别具有较低的排序&#39;价值...例如像这样:
categories => protectedTYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorageprototypeobject (2 items)
00000000443eb767000000007f371fa2 => GeorgRinger\News\Domain\Model\Categoryprototypepersistent entity (uid=19, pid=1)
sorting => protected 8 (integer)
title => protected 'Corporates' (10 chars)
uid => protected 19 (integer)
00000000443eb763000000007f371fa2 => GeorgRinger\News\Domain\Model\Categoryprototypepersistent entity (uid=5, pid=56)
sorting => protected 16 (integer)
title => protected 'Press Releases' (14 chars)
uid => protected 5 (integer)
当我想要访问来自主[17] Media&amp ;;的记录时,我无法访问记录详细信息页面(永远加载)。按列表视图...过了一会儿我得到这个错误:
Uncaught TYPO3 Exception
An exception occurred while executing 'SELECT * FROM `sys_template` WHERE (`pid` = ?) AND ((`sys_template`.`deleted` = 0) AND (`sys_template`.`hidden` = 0) AND (`sys_template`.`starttime` <= 1509472200) AND ((`sys_template`.`endtime` = 0) OR (`sys_template`.`endtime` > 1509472200))) ORDER BY `root` DESC, `sorting` ASC LIMIT 1' with params [1]: PHP Warning: mysqli::prepare(): MySQL server has gone away in /is/htdocs/path/www/typo3_src-8.7.8/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php line 92
TYPO3 8.7.8&amp; tx_news 6.1.1
编辑:
...其中pageID [97]也是主要新闻列表视图的详细页面:[17] Media&amp;按:
[17] Media & Press
|_[97] News Articles
|_[96] News Archive
...配置为:
[17] Media & Press
- What to display: List View (without overloading Detail view)
- Starting Point: Media & Press (sys) [96]
- Category Selection: Press Releases, Weekly Update
- Category Mode: Show items with selected categories (OR)
- PageId for single news display: News Articles [97]
- PageId for list display: Media & Press [17]
[97] News Articles
- What to display: Detail View
- PageId to return to: [17] Media & Press