18zehn
18zehn

Reputation: 182

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?

Upvotes: 0

Views: 182

Answers (1)

Thomas L&#246;ffler
Thomas L&#246;ffler

Reputation: 6174

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.

Upvotes: 1

Related Questions