我有一个在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插件并将其结果传递给模板.这是伪代码,描述了我想要实现的目标:
$data['###SOME_VARIABLE###'] = $someOtherPlugin->main();
$this->cObj->substituteMarkerArray($someTemplate, $data);
Run Code Online (Sandbox Code Playgroud)
可能吗?
谢谢!
我写了一个扩展,并通过后端实现插件完成所有事情.
但是当我尝试通过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 _..."文件
是否可以通过TypoScript自动生成混合的数字和字母串,例如12A54类似的东西?
我在扩展程序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) 为了显示新闻我已经为我的主题的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)
但这种情况不起作用.所以我的问题:出了什么问题?我如何管理这个工作,为条件获得正确的价值?我希望任何人都可以提前帮助.
有没有办法阻止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 CMS 后端字段?即提到的 csc_styled_content 内容元素字段?
在 powermail 文档中,它提到了一个字段的布局下拉列表:
管理员可以添加、删除或重命名某些条目。
如何在下拉菜单中添加布局选项?
您如何指定新选项将添加的类?
我们有一个打字稿配置来告诉 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 ×10
typoscript ×10
fluid ×2
backend ×1
extbase ×1
javascript ×1
plugins ×1
powermail ×1
templavoila ×1
tx-news ×1
typo3-6.2.x ×1
typo3-7.6.x ×1
typo3-9.x ×1
typo3-tca ×1