有人知道,我如何在 Typo3 6.1.5 中使用内容类型文件链接创建的下载列表中显示文件图标?在较旧的 Typo 版本中,我使用了扩展 css_filelinks,但它不再起作用了。
我当前的排版设置:
tt_content.uploads.20.renderObj = COA
tt_content.uploads.20.renderObj.20.data = file:current:title //file:current:description // file:current:name
有人知道,我如何在 Typo3 6.1.5 中使用内容类型文件链接创建的下载列表中显示文件图标?在较旧的 Typo 版本中,我使用了扩展 css_filelinks,但它不再起作用了。
我当前的排版设置:
tt_content.uploads.20.renderObj = COA
tt_content.uploads.20.renderObj.20.data = file:current:title //file:current:description // file:current:name
首先,要让 TYPO3 显示来自文件链接内容元素的文件图标,您需要选择除默认设置之外的任何其他 CE 布局(在外观选项卡中)。
现在 TYPO3 在文件前面加上图标。你可能不会觉得它们太漂亮。如果是这样,您可以使用 TypoScript 配置图标的文件路径结束类型:
# path to the folder containing the icons
tt_content.uploads.20.renderObj.15.file.import = fileadmin/folder/to/my/icons/
# wrap to indicate the file type of the icons (defaults to |.gif)
tt_content.uploads.20.renderObj.15.file.wrap = |.png
如果你想在不设置布局的情况下全局显示图标,去掉相应的 if 语句:
tt_content.uploads.20.renderObj.15.stdWrap.if >
当然你也可以只使用 CSS 选择器来显示正确的图标:
a[href $='.pdf'] { background: url('icons/pdf.png') no-repeat 1px 2px; padding-left: 20px; }
没有可以使用的 CSS 类吗?
像这样:
span.csc-uploads-fileName {
background: url("../img/icon.png") no-repeat scroll 0 0 transparent;
height: 40px;
width: 43px;
text-indent: -999em;
}