簡體   English   中英

TYPO3文本媒體元素應從選定的sys類別中獲取類

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

我想要達到以下目標:我正在創建一個新的內容元素“文本媒體”,填寫標題,文本,也許還要選擇一個圖像。 我還創建了在“類別”標簽下選擇的類別。 現在,我想將這些選定的類別集成到流體模板中,以使其可用作javascript過濾器。

我該如何完成這項任務?

謝謝!

您可以使用DataProcessor來獲取類別數據。 您需要為textmedia元素擴展TypoScript。

類別示例: https : //git.spooner.io/spooner/just_news/blob/master/Configuration/TypoScript/RenderingDefinitions/news_list.ts#L23

DataProcessor文檔: 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
        }
    }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM