Question

i want to add the language id in a typolink

so far

    LOGO = COA
    LOGO {
        10 = TEXT
        10 {
            value = logo
            typolink {
                parameter = 116
                additionalParams = &L={$config.sys_language_uid}
            }
        }
    }

if L=4 it's working

but if i use L={$config.sys_language_uid} it gets ignored altogether

same with L=GP:L and L=GPvar:L

what would be the proper syntax here

Was it helpful?

Solution

working if i do something like

                additionalParams = COA
                additionalParams {
                  10 = TEXT
                  10.data = GP : L
                  10.intval = 1
                  10.wrap = &L=|
                }

OTHER TIPS

You do not need to do that on your own. With the following global TypoScript configuration the parameter L will added to every link:

config.linkVars = L(int)

So, if you use HMENU.special = language this will be managed on the switch automatically, too:)

http://docs.typo3.org/typo3cms/TyposcriptReference/Setup/Config/Index.html

I do not know about {$config.sys_language_uid}, but your code will output it as plain text. In order to use variables like {GP:L}, you got to dataWrap it or insert "insertData" after the value.

10 = TEXT
10 {
    value = logo
    typolink {
        parameter = 116
        additionalParams.dataWrap = &L={GP:L}
    }
}

OR (the best way I'd say):

10 = TEXT
10 {
    value = logo
    typolink {
        parameter = 116
        additionalParams.cObject = TEXT
        additionalParams.cObject {
            wrap = &L=|
            data = GP:L
        }
    }
}

Using {TSFE:sys_language_uid} might be a better option if you are querying the database.

There is no need to make a cObject or COA

additionalParams = type=0&L={GP:L}
additionalParams.insertData = 1
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top