如何在typo3 EXT:gridelements的内容元素向导中设置图标
如何设置网格元素的图标(向导) 似乎有了一些改变,因为我以前做的方式已经不起作用了 我在文档中找不到这方面的信息 typo3版本7.LTS/Gridelements 7.0.5如何在typo3 EXT:gridelements的内容元素向导中设置图标,typo3,Typo3,如何设置网格元素的图标(向导) 似乎有了一些改变,因为我以前做的方式已经不起作用了 我在文档中找不到这方面的信息 typo3版本7.LTS/Gridelements 7.0.5 tx_gridelements { overruleRecords = 1 setup { TB_3col { title = Drei Spalten einfach description = (33-33-33; 50-25-25; 25-50-25; 25-25-50) (
tx_gridelements {
overruleRecords = 1
setup {
TB_3col {
title = Drei Spalten einfach
description = (33-33-33; 50-25-25; 25-50-25; 25-25-50) (12er Grid)
topLevelLayout = 1
icon = EXT:myext/Resources/Public/Icon/grid.png
config {
colCount = 3
rowCount = 1
rows {
1 {
columns {
1 {
name = Spalte 1
colPos = 101
}
2 {
name = Spalte 2
colPos = 102
}
3 {
name = Spalte 3
colPos = 103
}
}
}
}
}
}
}
在Gridelements的问题跟踪程序中查看此线程,以获得一些示例 您可以使用图标标识符或其他图标文件的路径,但不能同时使用两者。 图标标识符只能在您使用core的图标API方法正式注册图标时使用。 设置标识符将始终覆盖iconFile中的路径,因为注册图标是处理TYPO3中图标文件的推荐方法 对于Gridelements本身,这是在ext_tables.php中完成的
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
$iconRegistry->registerIcon('gridelements-default', \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, array(
'source' => 'EXT:gridelements/Resources/Public/Icons/gridelements.svg'
));
规则是:
您可以自己提供iconIdentifier和iconIdentifierLarge,但是您必须事先注册图标,安装程序中提供的任何图标文件都将被忽略
如果您在设置中提供了带有icon和iconLarge的图标文件,则会自动生成标识符,因此您不应手动设置它们。查看Gridelements问题跟踪程序中的此线程以获取一些示例 您可以使用图标标识符或其他图标文件的路径,但不能同时使用两者。 图标标识符只能在您使用core的图标API方法正式注册图标时使用。 设置标识符将始终覆盖iconFile中的路径,因为注册图标是处理TYPO3中图标文件的推荐方法 对于Gridelements本身,这是在ext_tables.php中完成的
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
$iconRegistry->registerIcon('gridelements-default', \TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class, array(
'source' => 'EXT:gridelements/Resources/Public/Icons/gridelements.svg'
));
规则是:
您可以自己提供iconIdentifier和iconIdentifierLarge,但是您必须事先注册图标,安装程序中提供的任何图标文件都将被忽略
如果您在设置中提供了带有icon和iconLarge的图标文件,则会自动生成标识符,因此您不应手动设置它们。我刚刚找到了解决方案<代码>图标切换到图标标识符
tx_gridelements {
overruleRecords = 1
setup {
TB_2col {
title =Zwei Spalten einfach
description = (50-50; 66-33; 33-66; 75-25; 25-75) (12er Grid)
topLevelLayout = 1
iconIdentifier = default-icon
flexformDS = FILE:EXT:fred/Configuration/FlexForms/Grid/TB_2col.xml
config {
colCount = 2
rowCount = 1
rows {
1 {
columns {
1 {
name = Spalte 1
colPos = 101
}
2 {
name = Spalte 2
colPos = 102
}
}
}
}
}
}
}
在ext\u tables.php中添加图标
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Core\Imaging\IconRegistry::class
);
$iconRegistry->registerIcon(
'default-icon',
\TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class,
['source' => 'EXT:myext/Resources/Public/Images/CE/myicon.png']
);
我刚刚找到了解决办法<代码>图标
切换到图标标识符
tx_gridelements {
overruleRecords = 1
setup {
TB_2col {
title =Zwei Spalten einfach
description = (50-50; 66-33; 33-66; 75-25; 25-75) (12er Grid)
topLevelLayout = 1
iconIdentifier = default-icon
flexformDS = FILE:EXT:fred/Configuration/FlexForms/Grid/TB_2col.xml
config {
colCount = 2
rowCount = 1
rows {
1 {
columns {
1 {
name = Spalte 1
colPos = 101
}
2 {
name = Spalte 2
colPos = 102
}
}
}
}
}
}
}
在ext\u tables.php中添加图标
$iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Core\Imaging\IconRegistry::class
);
$iconRegistry->registerIcon(
'default-icon',
\TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class,
['source' => 'EXT:myext/Resources/Public/Images/CE/myicon.png']
);
实际上,icon并没有切换到iconIdentifier,但两者都是可能的。因此,您可以注册图标并使用标识符,也可以直接添加图标,然后在引擎盖下为您完成注册。@Joey:不,不可能icon’已被弃用,在v7.6.15中肯定不再有效,只能使用iconIdentifier。真是一个PITA。实际上图标还没有切换到iconIdentifier,但两者都是可能的。因此,您可以注册图标并使用标识符,也可以直接添加图标,然后在引擎盖下为您完成注册。@Joey:不,不可能icon’已被弃用,在v7.6.15中肯定不再有效,只能使用iconIdentifier。多美的皮塔。