useStdWrap 与 tx_news 中的 overrideFlexformSettingsIfEmpty 冲突 [英] useStdWrap conflicts with overrideFlexformSettingsIfEmpty in tx_news

查看:15
本文介绍了useStdWrap 与 tx_news 中的 overrideFlexformSettingsIfEmpty 冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 tx_news 中,所有插件设置也可以通过 TypoScript 进行设置,方法是将它们的名称添加到 overrideFlexformSettingsIfEmpty.顾名思义,这些基于 TS 的设置仅在任何插件化身的相应 Flexform 字段留空时使用.这就是我想要的,也是我需要的.它允许可以在每个插件元素中覆盖的基本 TS 配置.

问题来了:

由于我的 TS 默认值需要更复杂的计算,我还为某些 tx_news 设置字段激活了 useStdWrap.但是我发现一个活动的 stdWrap 总是会被使用——无论是否有 Flexform 设置.

我需要的是可以使用 TS stdWrap 来计算默认值,但是如果定义了 Flexform 设置,它应该始终覆盖 TS 设置(无论它们的计算有多复杂以及是否包含 stdWrap 操作).

这是一个例子:

plugin.tx_news.settings {overrideFlexformSettingsIfEmpty := addToList(categories)useStdWrap := addToList(categories)类别.数据 = GP:cat类别.ifEmpty = 1}

我希望这个 TS 从查询字符串参数 (cat) 设置任何新闻插件的类别并回退到类别 1,但如果插件本身没有设置类别.

但是 stdWrap 操作(.data 和 .ifEmpty)总是,并且无法再使用 Flexform 设置.

有没有办法解决这个问题?

解决方案

没有办法为每个人解决这个问题,因为如果改变它,就会有其他缺点.

一种解决方案是使用钩子 $GLOBALS['TYPO3_CONF_VARS']['EXT']['news']['Controller/NewsController.php']['overrideSettings'] 其中您可以操作 PHP 中的设置,拥有您需要的一切.

In tx_news all plugin settings can also be set via TypoScript by adding their names to overrideFlexformSettingsIfEmpty. As the name suggests, these TS based settings are only used, if the corresponding Flexform fields of any plugin incarnation are left empty. This is what I want and what I need. It allows for a basic TS configuration that can be overwritten within each plugin element.

Now here's the problem:

As my TS default values need more complex calculations, I also activate useStdWrap for some of the tx_news settings fields. But I found that an active stdWrap will ALWAYS be used – no matter whether there are Flexform settings or not.

What I need is the possibility to use TS stdWrap to calculate default values, but if a Flexform setting is defined it should always override the TS settings (no matter how complex their calculation was and whether it included stdWrap operations).

Here is an example:

plugin.tx_news.settings {
    overrideFlexformSettingsIfEmpty := addToList(categories)
    useStdWrap := addToList(categories)

    categories.data = GP:cat
    categories.ifEmpty = 1
}

I would expect this TS to set the category of any news plugin from a query string parameter (cat) and fall back to category 1, but only if there are no categories set within the plugin itself.

But the stdWrap operations (.data and .ifEmpty) always kick in and there is no way to use the Flexform settings any more.

Is there a way to solve this?

解决方案

There is no way to fix this for everybody because if it would be changed, there would be other drawbacks.

One solution would be to use the hook $GLOBALS['TYPO3_CONF_VARS']['EXT']['news']['Controller/NewsController.php']['overrideSettings'] where you can manipulate the settings in PHP having everything you need.

这篇关于useStdWrap 与 tx_news 中的 overrideFlexformSettingsIfEmpty 冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆