【问题标题】:Typo3 6.x : How to show Icon (pdf, jpg,...) in my Downloadlist (content type filelinks)Typo3 6.x:如何在我的下载列表(内容类型文件链接)中显示图标(pdf、jpg、...)
【发布时间】:2013-10-03 16:44:35
【问题描述】:
有人知道,如何在 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
typoscript
typo3-6.1.x
【解决方案1】:
首先,要让 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; }
【解决方案2】:
没有可以使用的 CSS 类吗?
像这样:
span.csc-uploads-fileName {
background: url("../img/icon.png") no-repeat scroll 0 0 transparent;
height: 40px;
width: 43px;
text-indent: -999em;
}