2017-08-03 25 views
0

我想达到以下等级: 我创建一个新的内容要素“文字媒体”,填写标题,文字,或许选择一个图像。我还创建了在“类别”选项卡下选择的类别。 现在我想将这些选定的类别集成到流体模板中,以使其作为JavaScript过滤器工作。TYPO3文字媒体元素应该从选择SYS类

我怎样才能实现这个任务?

谢谢!

回答

0

您可以使用数据处理器以获得该类别的数据。您需要扩展textmedia元素的TypoScript。

类别例如:https://git.spooner.io/spooner/just_news/blob/master/Configuration/TypoScript/RenderingDefinitions/news_list.ts#L23

数据处理器文档:https://docs.typo3.org/typo3cms/TyposcriptReference/ContentObjects/Fluidtemplate/Index.html#dataprocessing

在这里你可以看到默认textmedia TS,添加的对象30:

# Text & Media: 
# Any number of media wrapped right around a regular text element. 
# 
# CType: textmedia 

tt_content.textmedia =< lib.contentElement 
tt_content.textmedia { 
templateName = Textmedia 
    dataProcessing { 
     10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor 
     10 { 
      references.fieldName = assets 
     } 
     20 = TYPO3\CMS\Frontend\DataProcessing\GalleryProcessor 
     20 { 
      maxGalleryWidth = {$styles.content.textmedia.maxW} 
      maxGalleryWidthInText = {$styles.content.textmedia.maxWInText} 
      columnSpacing = {$styles.content.textmedia.columnSpacing} 
      borderWidth = {$styles.content.textmedia.borderWidth} 
      borderPadding = {$styles.content.textmedia.borderPadding} 
     } 
     # Get categories 
     30 = TYPO3\CMS\Frontend\DataProcession\DatabaseQueryProcessor 
     30 { 
      put the login in... 
     } 
    } 
    stdWrap { 
     editIcons = tt_content: header [header_layout], bodytext, assets [imageorient|imagewidth|imageheight], [imagecols|imageborder], image_zoom 
     editIcons { 
      iconTitle.data = LLL:EXT:fluid_styled_content/Resources/Private/Language/FrontendEditing.xlf:editIcon.textmedia 
     } 
    } 
}