############################################
#### CTYPE: MENU OF CATEGORIZED CONTENT ####
############################################

tt_content.menu_categorized_content >
tt_content.menu_categorized_content =< lib.contentElement
tt_content.menu_categorized_content {

    ################
    ### TEMPLATE ###
    ################
    templateName = MenuCategorizedContent

    ##########################
    ### DATA PREPROCESSING ###
    ##########################
    dataProcessing {
        10 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
        10 {
            table = tt_content
            selectFields = tt_content.*
            groupBy = uid
            pidInList.data = leveluid : 0
            recursive = 99
            join.data = field:selected_categories
            join.wrap = sys_category_record_mm ON tt_content.uid = sys_category_record_mm.uid_foreign AND sys_category_record_mm.uid_local IN(|)
            where.data = field:category_field
            where.wrap = tablenames='tt_content' and fieldname='|'
            as = content
            dataProcessing {
                10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
                10 {
                    references.fieldName = image
                }
            }
        }
        90 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
        90 {
            if {
                isTrue.field = accessibility_bypass
            }
            table = tt_content
            pidInList = this
            orderBy = sorting
            max = 1
            where {
                dataWrap = colPos = {field:colPos} AND sorting > {field:sorting}
            }
            as = nextContentElement
        }
    }

}

