标签: typoscript

TYPO3:如果不是空的或在TemplaVoila中隐藏,则包裹RECORDS

我有一个在TemplaVoila中映射的字段作为"元素容器",它在"数据处理"中生成一些Typoscript:

10= RECORDS
10.source.current=1
10.tables = tt_content

# my new added wrap
10.wrap = <div class="someClass"> | </div>
Run Code Online (Sandbox Code Playgroud)

有没有办法让我的新包装依赖于填充这个容器?我需要与以下功能相同的功能:

10 = TEXT
10.wrap = not empty: |
10.required = 1
Run Code Online (Sandbox Code Playgroud)

编辑:我设法检查容器中是否有任何内容:

10= RECORDS
10.source.current=1
10.tables = tt_content
10.stdWrap.wrap = <div class="someClass"> | </div>
10.stdWrap.if {
 isTrue.field = field_contenttop
}
10.stdWrap.debugData = 1
Run Code Online (Sandbox Code Playgroud)

即使内部的内容被隐藏,它也可以包装容器.我需要仅依赖于可见元素.

typo3 typoscript templavoila

4
推荐指数
1
解决办法
8539
查看次数

从其他插件的主体调用TYPO3插件

我需要从其他插件的主体调用typo3插件并将其结果传递给模板.这是伪代码,描述了我想要实现的目标:

$data['###SOME_VARIABLE###'] = $someOtherPlugin->main();
$this->cObj->substituteMarkerArray($someTemplate, $data);
Run Code Online (Sandbox Code Playgroud)

可能吗?

谢谢!

typo3 typo3-tca typoscript

4
推荐指数
1
解决办法
2467
查看次数

TYPO3 4.7.2通过typoscript包含extbase插件

我写了一个扩展,并通过后端实现插件完成所有事情.

但是当我尝试通过typoscript实现我的扩展时,我每次都会收到此错误:

糟糕,发生错误!

无法确定默认控制器.请检查ext_localconf.php中的Tx_Extbase_Utility_Extension :: configurePlugin().

我不知道为什么..我尝试了不同的实现(根据tx_extbase_core_bootstrap-> run或tx_extbase_dispatcher-> dispatch以及附加信息而没有),当前的typoscript如下所示:

plugin.tx_graphichmenu {
    settings {
        menuUid = 1
    }
}

lib.tx_graphichmenu = USER
lib.tx_graphichmenu {
    userFunc = tx_extbase_core_bootstrap->run
    extensionName = Graphichmenu
    pluginName = Graphicmenu
    controller = MenuController
    action = showAction
}

temp.mainTemplate.subparts.stickyfooter < lib.tx_graphichmenu
Run Code Online (Sandbox Code Playgroud)

我双精度和三重检查一切,我发现没有一个单一的错......试过了没有"行动"和"调节器"的一部分,并没有什么改变

我在ext_localconf.php中的configurePlugin部分如下所示:

Tx_Extbase_Utility_Extension::configurePlugin(
    $_EXTKEY,
    'Graphicmenu',
    array(
        'Menu' => 'show',
    ),
    // non-cacheable actions
    array(
        'Menu' => '',
    )
);
Run Code Online (Sandbox Code Playgroud)

"show"动作没有参数.在那里我加载ts设置从我拿到对象的Uid显示

PS:每次更改后我都清除了缓存并删除了typo3conf中的"temp_CACHED _..."文件

plugins typo3 typoscript extbase

4
推荐指数
1
解决办法
4064
查看次数

通过TypoScript生成随机字符串

是否可以通过TypoScript自动生成混合的数字和字母串,例如12A54类似的东西?

typo3 typoscript

4
推荐指数
3
解决办法
1726
查看次数

如何:在流体中找到一个打字稿定义的数组的长度?

我在扩展程序setup.txt打字稿中定义一个数组,如下所示:

settings{
        halls {
            0 = Default
            1 = Mississauga   
            2 = Halifax
            3 = Niagara Falls 
            4 = Oakville 
            5 = Pickering 
        }}
Run Code Online (Sandbox Code Playgroud)

如何在流体模板中找到Halls数组的长度?我希望if条件如果长度大于1则做一件事,如果不大于1,则要做另一件事。

我在extbase 1.3中使用typo3 v4.5.32。

谢谢。我试过了,但是它发出了两个标签,而不是一个。第一个if表示要证明有多个元素,第二个if仅打印出第一个元素。

 <f:for each="{settings.halls}" as="hall" key="number" iteration="itemIteration">
   <f:if condition="{itemIteration.isFirst !=  itemIteration.isLast}">
      <f:if condition="{itemIteration.index ==  0}">
           <th><f:translate key="tx_bpscoupons_domain_model_coupon.hall" /></th>
       </f:if>    
   </f:if>
 </f:for>
Run Code Online (Sandbox Code Playgroud)

为什么?

更新:这是我的工作,因为流体中缺少“数组长度> 1”特征

<f:for each="{settings.halls}" as="hall" key="number" iteration="itemIteration">

   <f:if condition="{itemIteration.isFirst}">
      <f:then>
          <f:if condition="{itemIteration.isLast}">                                    
              // if both first and last there is only one so skip
          </f:if>
      </f:then>
   <f:else>
      <f:if condition="{itemIteration.isLast}">
         //if there …
Run Code Online (Sandbox Code Playgroud)

typo3 fluid typoscript

4
推荐指数
2
解决办法
4111
查看次数

如何在我的typoscript中设置tx_news特定条件?

为了显示新闻我已经为我的主题的PageTSconfig中配置的后端编辑器选择了不同的模板布局:

tx_news.templateLayouts {
        10 = LLL:EXT:mytheme/Resources/Private/Language/locallang.xlf:news.layout.withoutDate
        20 = LLL:EXT:mytheme/Resources/Private/Language/locallang.xlf:news.layout.highlightListView
        30 = LLL:EXT:mytheme/Resources/Private/Language/locallang.xlf:news.layout.imageTeaserListView
    }
Run Code Online (Sandbox Code Playgroud)

在我的流体模板中,我可以切换条件

<f:switch expression="{settings.templateLayout}">
  <f:case value="10">
  ... use layout 1
  </f:case>
  <f:case value="20">
  ... use layout 2
  </f:case>
  <f:case value="30">
  ... use layout 3
  </f:case>
</f:switch>
Run Code Online (Sandbox Code Playgroud)

一切都很好,直到这里.

现在我想只为其中一个模板布局嵌入javascript.所以我试图将js包含在typoscript中的条件中,询问此templateLayout设置中的值.像这样的东西:

[globalVar = GP:tx_news_pi1|settings|templateLayout=30]
page{
    includeJSFooter {
        test = EXT:mytheme/Resources/Public/JavaScript/news-test.js
    }
}
[global]
Run Code Online (Sandbox Code Playgroud)

但这种情况不起作用.所以我的问题:出了什么问题?我如何管理这个工作,为条件获得正确的价值?我希望任何人都可以提前帮助.

javascript typo3 conditional-statements typoscript tx-news

4
推荐指数
1
解决办法
428
查看次数

Typoscript IMAGE对象:禁用高度/宽度属性

有没有办法阻止typo3/typoscript IMAGE对象添加维度属性(高度和宽度)到生成的图像标签?

更新(感谢cascaval)!

解决方案是使用IMG_RESOURCE而不是IMAGE.它显然没有哨声,但让你完全控制生成的图像标签.

   10 = IMG_RESOURCE
   10.file.import = uploads/tx_templavoila/
   10.file.import.current = 1
   10.file.import.listNum = 0
   10.stdWrap.required = 1
   10.stdWrap.wrap (
      <img src="|" />
   )
Run Code Online (Sandbox Code Playgroud)

注意:这适用于Templavoila.

typo3 typoscript

3
推荐指数
1
解决办法
8050
查看次数

如何在TYPO3 CMS后端重命名副标题

如何为作者重命名 TYPO3 CMS 后端字段?即提到的 csc_styled_content 内容元素字段?

typo3 backend typoscript typo3-6.2.x

3
推荐指数
1
解决办法
876
查看次数

Powermail 中的添加、重命名或删除布局选项

在 powermail 文档中,它提到了一个字段的布局下拉列表:

管理员可以添加、删除或重命名某些条目。

如何在下拉菜单中添加布局选项?

您如何指定新选项将添加的类?

typo3 fluid typoscript powermail typo3-7.6.x

3
推荐指数
1
解决办法
2622
查看次数

如何用方面替换 TYPO3 9 中的 data = TSFE:sys_language_uid

我们有一个打字稿配置来告诉 CSS 我们使用哪种语言,使用 classnames 将一个类添加到 body 标签中language-x

由于似乎没有关于如何在 Typoscript 中执行此操作的记录,因此我还没有尝试太多来解决这个问题。

为此,我们使用了以下打字稿:

// Language
    30 = TEXT
    30 {
        data = TSFE:sys_language_uid
        noTrimWrap = | language-||
    }
Run Code Online (Sandbox Code Playgroud)

现在这提出了E_USER_DEPRECATED

Property $TSFE->sys_language_uid is not in use anymore as this information is now stored within the language aspect
Run Code Online (Sandbox Code Playgroud)

提前致谢。问候托米

typo3 typoscript typo3-9.x

3
推荐指数
1
解决办法
2321
查看次数