简体   繁体   中英

TYPO3 ignores Language in categories select

I am selecting categories on an English page. The categories have the language ID 0. English is ID 1.

But I need the same categories on both languages.

cheese = CONTENT
cheese {
    wrap = <cheese_legend>|</cheese_legend>
    table = sys_category
    select {
        pidInList = {$categories}
        selectFields = *
        where = deleted = 0
        andWhere = sys_language_uid = 0
        andWhere = hidden = 0
    }
    renderObj = COA
    renderObj {
        wrap = <cat>|</cat>
        10 = TEXT
        10 {
            stdWrap.field = uid
            stdWrap.wrap = <div>|</div>
        }
        20 = TEXT
        20 {
            stdWrap.field = title
            stdWrap.wrap = <div>|</div>
        }
        30 = TEXT
        30 {
            stdWrap.field = sys_language_uid
            stdWrap.wrap = <div>|</div>
        }
    }
}

So I'm explicitly selecting the sys_language_uid = 0!! But nevertheless the script only gives me results with the ID = 1.

Any idea to make this baby work?

You have doubled the andWhere = statement, so the one below overwrites the one above.

Use andWhere = sys_language_uid = 0 AND hidden = 0 in one line.

For getting the english ones you use andWhere = sys_language_uid = 1 AND hidden = 0 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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