0
votes

i am new in typo3. i am facing problem with language. i have made a page name as footer and set content in both of my languages i.e de,en.

lib.content_from_page3 = COA
lib.content_from_page3 {
    10 = CONTENT
    10 {
        table = tt_content
        select.where = colPos = 0
        select.pidInList = 48
    }
}
lib.content_from_page4 = COA
lib.content_from_page4 {
    10 = CONTENT
    10 {
        table = tt_content
        select.where = colPos = 0
        select.pidInList = 52
    }
}

This is my typoscript that is set in template. and

<f:cObject typoscriptObjectPath="lib.content_from_page3" />

<f:cObject typoscriptObjectPath="lib.content_from_page4" /> 

this is code of accessing the data. lib.content_from_page3 is content that is default language and lib.content_from_page4is in english language.

problem is that when default language is selected everything is fine but when english is selected there is no data

is any one who can help me.

1

1 Answers

0
votes

Make sure you have already made language configuration properly like below

# Localization:
config {
    linkVars = L(int)
    sys_language_uid = 0
    sys_language_overlay = 1
    sys_language_mode = content_fallback
    language = en
    locale_all = en_US.UTF-8
    htmlTag_setParams = lang="en" dir="ltr" class="no-js"
}
[globalVar = GP:L = 1]
    config {
            sys_language_uid = 1
            language = de
            locale_all = de_DE.UTF-8
            htmlTag_setParams = lang="de" dir="ltr" class="no-js"
    }
[global]

May This object can helps you

lib.dynamicContent = COA
lib.dynamicContent {
10 = LOAD_REGISTER
10 {
  colPos.cObject = TEXT
  colPos.cObject {
     field = colPos
     ifEmpty.cObject = TEXT
     ifEmpty.cObject {
        value.current = 1
        ifEmpty = 0
     }
  }
  pageUid.cObject = TEXT
  pageUid.cObject {
     field = pageUid
     ifEmpty.data = TSFE:id
  }
  contentFromPid.cObject = TEXT
  contentFromPid.cObject {
     data = DB:pages:{register:pageUid}:content_from_pid
     data.insertData = 1
  }
  wrap.cObject = TEXT
  wrap.cObject {
     field = wrap
  }
}
20 = CONTENT
20 {
  table = tt_content
  select {
     includeRecordsWithoutDefaultTranslation = 1
     orderBy = sorting
     where = {#colPos}={register:colPos}
     where.insertData = 1
     pidInList.data = register:pageUid
     pidInList.override.data = register:contentFromPid
  }
  stdWrap {
     dataWrap = {register:wrap}
     required = 1
  }
}
30 = RESTORE_REGISTER
}

and put this in your template file

< f:cObject typoscriptObjectPath="lib.dynamicContent" data="{colPos: '0',pageUid:'52'}" />
<f:cObject typoscriptObjectPath="lib.dynamicContent" data="{colPos: '0',pageUid:'48'}" />

If an above object can not help you then please try below the object

lib.content_from_page3 = COA
lib.content_from_page3 {
10 = CONTENT
10 {
 table = tt_content

select {

    pidInList = {$config.logopageId}

    where = colPos = 0 

    max = 1

    languageField = sys_language_uid

}
}
}

Let me know know if you need any help!!

Welcome in TYPO3!:)