简体   繁体   English

TMENU的Typo3资源媒体文件/ sys_file_reference

[英]Typo3 resources media files/sys_file_reference for TMENU

How can I use resources media files -> Description (Caption) for altTag/altText in menu. 如何在菜单中使用资源媒体文件 - >描述(标题)for altTag / altText。

In TYPO3 you have the possibility to use the page properties for a resource image and to set additional metadata. 在TYPO3中,您可以使用页面属性作为资源图像并设置其他元数据。 I found this reference: data [sys_file_reference] [6] [description] 我找到了这个引用:data [sys_file_reference] [6] [description]

NO = 1 
NO {
   ATagTitle.field = title
   wrapItemAndSub = |</li>
   allWrap = <li>| 
   after.cObject = IMAGE 
   after.cObject {
      file.import.field = media
      file.import = uploads/media/ 
      file.import.listNum = 0
      file.width = 250c 
      altText = {???:description}
      altText.insertData = 1 
   }
   stdWrap.htmlSpecialChars = 1
}

Since TYPO3 6.0 the media field uses File Abstraction Layer (FAL) to create references to uploaded objects (eg images). 从TYPO3 6.0开始,媒体字段使用文件抽象层(FAL)来创建对上载对象(例如图像)的引用。 Because of this change, you can't use the IMAGE content object to fetch the inserted object, but first have to use the FILES content object. 由于此更改,您无法使用IMAGE内容对象来获取插入的对象,但首先必须使用FILES内容对象。

For you case, the TypoScript should look like this: 对于你的情况,TypoScript应该如下所示:

  after.cObject = FILES 
  after.cObject {
    references.data =  levelmedia:-1, slide
    references.listNum = 0
    renderObj = IMAGE
    renderObj.altText.data = file:current:description
    renderObj.file {
      import.data = file:current:publicUrl
      width = 250c
    }
  } 

References: http://docs.typo3.org/typo3cms/TyposcriptReference/ContentObjects/Files/Index.html 参考文献: http//docs.typo3.org/typo3cms/TyposcriptReference/ContentObjects/Files/Index.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM