简体   繁体   English

TYPO3文本媒体元素应从选定的sys类别中获取类

[英]TYPO3 Text Media Element should get class from selected sys category

I want to reach the following: I'm creating an new content element "text media", fill out title, text and perhaps select an image. 我想要达到以下目标:我正在创建一个新的内容元素“文本媒体”,填写标题,文本,也许还要选择一个图像。 I also created categories which I select under the tab "categories". 我还创建了在“类别”标签下选择的类别。 Now I want to integrate these selected categories in the fluid template to make it work as an javascript filter. 现在,我想将这些选定的类别集成到流体模板中,以使其可用作javascript过滤器。

How can I achieve this task? 我该如何完成这项任务?

Thanks! 谢谢!

You can use a DataProcessor to get the category data. 您可以使用DataProcessor来获取类别数据。 You need to extend the TypoScript for the textmedia element. 您需要为textmedia元素扩展TypoScript。

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

DataProcessor documentation: https://docs.typo3.org/typo3cms/TyposcriptReference/ContentObjects/Fluidtemplate/Index.html#dataprocessing DataProcessor文档: https ://docs.typo3.org/typo3cms/TyposcriptReference/ContentObjects/Fluidtemplate/Index.html#dataprocessing

Here you can see the default textmedia TS, added object 30: 在这里,您可以看到默认的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
        }
    }
}

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

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