如何在不使用TSFE上下文的情况下创建内容幻灯片

时间:2017-02-22 08:55:33

标签: typo3 typoscript typo3-7.6.x

我使用content_from_pid字段从全局sys文件夹而不是页面本身接收页面内容。这很好但我想从原始页面上下文添加标题图像,如果页面本身不存在,则页面图像应该从父页面继承。

另一种方法是使用“插入记录”内容元素。但缺点是,不会引用全局sys文件夹中的新内容。您必须将每个引用sys-folder的“insert records”元素中的新内容与新内容链接起来。

所以我需要一种方法来定义由content_from_pid触发的一般内容替换的例外。

技术上content_from_pid触发核心“/typo3/sysext/frontend/Classes/Page/PageGenerator.php”中的clone $tsfe;

所以我想我必须要么覆盖这个核心函数,要么修改只有styles.content.get的TS,使用不同的colPos和slide = -1 atm。

示例页面树:

- [1] global content
-- [2] content source for product Y
-- [7] content source for contact pages

- [3] home page with header image Z
-- [4] product Y page with content-from-pid 2 and headerimg Z from 3
-- [5] page with normal content and header image from 3
-- [6] another page with content-from-pid 7 and headerimg Z from 3

- [8] home page with header image X
-- [9] product Y page with content-from-pid 2 and headerimg X from 8
-- [10] page with normal content and header image from 8
-- [11] another page with content-from-pid 7 and headerimg X from 8

1 个答案:

答案 0 :(得分:0)

这是不可能的,因为当前页面的呈现永远不会开始,因为它会被重定向到content_from_pid页面。

您应该创建一个小内容元素(或滥用其他一些内容元素)并调整渲染,而不是使用content_from_pid页面。您可以使用CONTENT对象来呈现其他pid内容,只要您能够以某种方式获取此pid