Zum Inhalt springen

Mehrsprachigkeit multi tree

Erstellt am 27. Januar 2020 · 7 Antworten · letzte Antwort am 27. Januar 2020

Tags: TYPO3 8, Frage

sanktusm ·

Hallo,
ich möchte eine mehrsprachige Seite mit unterschliedlichen Menupunkten je Sprache aufbauen (multi tree)
Leider habe ich dazu wenig Tutorial gefunden.

Das Problem: wenn ich zwei Rootpages anlege funktioniert die Seite nicht mehr. (Templates werden nicht geladen. Könnte mir jemand erklären wie ich das am besten machen kann?

Hier meine page.ts:

page = PAGE

page {

config.contentObjectExceptionHandler = 1

config.baseURL = https://localhost/vws-f1/

config.absRelPath = /

config.tx_realurl_enable = 1

# setzt den html Tag im Seitenheader z.B. für html5 Seiten
config.htmlTag_setParams = lang="de"

# Wird benötigt um automatisch die Srachdateien in Extensions zu finden
config.language = de

# Angabe für php um sprachspezifische Ausgabe zu ermöglichen, z.B. Datumsformat
config.locale_all = de_DE.UTF-8

#Linkvariable für die Sprache setzten
config.linkVars = L

# Bei der empfohlenen Einstellung "content_fallback" bleibt das Frontend
# in der entsprechenden Sprache auch wenn die Seite nicht übersetzt ist:
# Die Menüs werden immer noch in der richtigen Sprache angezeigt, der
# Content wird in der Standardsprache angezeigt.
config.sys_language_mode = content_fallback

# Nicht übersetzter Content: Content in Default anzeigen
config.sys_language_overlay = 1

lib.currentPageId = TEXT
lib.currentPageId.data = TSFE:id

meta{
viewport = width=device-width, initial-scale=1, maximum-scale=1
}


footerData {
20 = TEXT
20.value (

)
}

10 = FLUIDTEMPLATE

10 {



file = fileadmin/templates/content/template.html

partialRootPath = fileadmin/templates/content
layoutRootPath = fileadmin/layout

variables {

search < styles.content.get
search.select.where = colPos=3

content < styles.content.get
content.select.where = colPos=0

footer < styles.content.get
footer.select.where = colPos=2

logo < styles.content.get
logo.select.where = colPos=1



}

}




includeCSS.bootmin = fileadmin/bootstrap/css/bootstrap.min.css

includeCSS.font = https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css

includeCSS.line = fileadmin/bootstrap/css/et-line.css

includeCSS.carousel = fileadmin/bootstrap/css/owl.carousel.css

includeCSS.megamenu = fileadmin/bootstrap/css/mdf_megamenu.css

includeCSS.mega = fileadmin/bootstrap/css/mega.css

includeCSS.general = fileadmin/css/style.css

includeCSS.responsiveTable = fileadmin/css/responsive-table.css

includeCSS.facebox = fileadmin/css/facebox.css

includeJS.jquery = fileadmin/bootstrap/js/jquery-1.9.1.min.js

includeJSFooter.mdf = fileadmin/bootstrap/js/mdf_js.min.js

includeJSFooter.carousel = fileadmin/bootstrap/js/owl.carousel.min.js

includeJSFooter.gmap = fileadmin/bootstrap/js/gmap3.min.js

includeJSFooter.bootjs = fileadmin/bootstrap/js/bootstrap.min.js

includeJSFooter.facebox = fileadmin/bootstrap/js/facebox.js

}

}

sanktusm ·

Damit bekomme ich nur eine Leere Seite

page = PAGE




page {

 config.contentObjectExceptionHandler = 1 
 
 config.baseURL = https://localhost/vws-f1/
 
 config.absRelPath = /
 
 config.tx_realurl_enable = 1
 
 config.simulateStaticDocuments = 1
 
config.sys_language_uid = 1
 
config.language = de
 
config.locale_all = de_DE
 
config.htmlTag_langKey = de
 
config.linkVars := addToList(L)
 
config.uniqueLinkVars = 1
 
config.sys_language_mode = content_fallback
 
config.sys_language_overlay = 1

[globalVar = GP:L = 103]
 
config.sys_language_uid = 103
 
config.language = en
 
config.locale_all = en_EN
 
config.htmlTag_langKey = en
 
[global]
 
[globalVar = GP:L = 1]
 
config.sys_language_uid = 1
 
config.language = de
 
config.locale_all = de_DE
 
config.htmlTag_langKey = de
 
[global]

lib.currentPageId = TEXT
lib.currentPageId.data = TSFE:id 

meta{    
     viewport = width=device-width, initial-scale=1, maximum-scale=1    
     }
     
     
footerData {
  20 = TEXT
  20.value (

 

)
}    

10 = FLUIDTEMPLATE
  
  10 {
  
   
  
    file = fileadmin/templates/content/template.html
    
    partialRootPath = fileadmin/templates/content
    layoutRootPath = fileadmin/layout
    
    variables {
    
      search < styles.content.get
      search.select.where = colPos=3
      
      content < styles.content.get
      content.select.where = colPos=0
      
      footer < styles.content.get
      footer.select.where = colPos=2
      
      logo < styles.content.get
      logo.select.where = colPos=1
      
     
    
    }
    

  
  } 
  
  
     
  
  includeCSS.bootmin = fileadmin/bootstrap/css/bootstrap.min.css
  
  includeCSS.font = https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css
  

    
    includeCSS.line = fileadmin/bootstrap/css/et-line.css
    
    includeCSS.carousel = fileadmin/bootstrap/css/owl.carousel.css
    
    includeCSS.megamenu = fileadmin/bootstrap/css/mdf_megamenu.css
    
    includeCSS.mega = fileadmin/bootstrap/css/mega.css
    
    includeCSS.general = fileadmin/css/style.css
    
    includeCSS.responsiveTable = fileadmin/css/responsive-table.css
    
    includeCSS.facebox = fileadmin/css/facebox.css
    
    includeJS.jquery =  fileadmin/bootstrap/js/jquery-1.9.1.min.js
    
    includeJSFooter.mdf =  fileadmin/bootstrap/js/mdf_js.min.js
    
    includeJSFooter.carousel =  fileadmin/bootstrap/js/owl.carousel.min.js
    
    includeJSFooter.gmap =  fileadmin/bootstrap/js/gmap3.min.js
    
    includeJSFooter.bootjs =  fileadmin/bootstrap/js/bootstrap.min.js
    
    includeJSFooter.facebox =  fileadmin/bootstrap/js/facebox.js


}  


}
Julian.​Hofmann ·

Der zweite Teil schaut doch schon ganz gut aus....

Du verwendest innerhalb Deines page-Blocks Conditions. Das lässt die TyposScript-Synatx nicht zu. Conditions müssen immer auf oberste Ebene stehen, d.h. nicht in geklammerten Blöcken.

"[global][globalVar = GP:L = 1]" darf so nicht stehen. Da muss ein Zeilenumbruch dazwischen.

Und bist Du Dir sicher, dass Englisch die sys_language_uid 103 hat? Die ID ist normal die UID des Datensatzes der Sprache aus der Tabelle "sys_language". Wenn Deine Seite nur DE & EN ist, dass bezweifel ich, dass in der Tabelle bereits 103 Einträge sind, d.h. eine Sprache bzw. Englisch die UID 103 hat.

sanktusm ·

Erst mal vielen Dank für den Tippp. Englisch ist im Backend nicht installiert. Wie kann ich die uid von Englisch herausfinden oder einrichten?

sanktusm ·

Ok die Sprachen habe ich nun einrichten können. Leider erscheint immer noch eine blanke Seite mit diesem Script:

page = PAGE

page {

config.contentObjectExceptionHandler = 1

config.baseURL = https://localhost/vws-f1/

config.absRelPath = /

config.tx_realurl_enable = 1

config.simulateStaticDocuments = 1

config.sys_language_uid = 1

config.language = de

config.locale_all = de_DE

config.htmlTag_langKey = de

config.linkVars := addToList(L)

config.uniqueLinkVars = 1

config.sys_language_overlay = 1

[globalVar = GP:L = 1]

config.sys_language_uid = 1

config.language = en

config.locale_all = en_EN

config.htmlTag_langKey = en

[global]

[globalVar = GP:L = 2]

config.sys_language_uid = 2

config.language = de

config.locale_all = de_DE

config.htmlTag_langKey = de

[global]

lib.currentPageId = TEXT
lib.currentPageId.data = TSFE:id

meta{
viewport = width=device-width, initial-scale=1, maximum-scale=1
}


footerData {
20 = TEXT
20.value (

)
}

10 = FLUIDTEMPLATE

10 {



file = fileadmin/templates/content/template.html

partialRootPath = fileadmin/templates/content
layoutRootPath = fileadmin/layout

variables {

search < styles.content.get
search.select.where = colPos=3

content < styles.content.get
content.select.where = colPos=0

footer < styles.content.get
footer.select.where = colPos=2

logo < styles.content.get
logo.select.where = colPos=1



}

}




includeCSS.bootmin = fileadmin/bootstrap/css/bootstrap.min.css

includeCSS.font = https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css

includeCSS.line = fileadmin/bootstrap/css/et-line.css

includeCSS.carousel = fileadmin/bootstrap/css/owl.carousel.css

includeCSS.megamenu = fileadmin/bootstrap/css/mdf_megamenu.css

includeCSS.mega = fileadmin/bootstrap/css/mega.css

includeCSS.general = fileadmin/css/style.css

includeCSS.responsiveTable = fileadmin/css/responsive-table.css

includeCSS.facebox = fileadmin/css/facebox.css

includeJS.jquery = fileadmin/bootstrap/js/jquery-1.9.1.min.js

includeJSFooter.mdf = fileadmin/bootstrap/js/mdf_js.min.js

includeJSFooter.carousel = fileadmin/bootstrap/js/owl.carousel.min.js

includeJSFooter.gmap = fileadmin/bootstrap/js/gmap3.min.js

includeJSFooter.bootjs = fileadmin/bootstrap/js/bootstrap.min.js

includeJSFooter.facebox = fileadmin/bootstrap/js/facebox.js

}

}
sanktusm ·

Etwas bin ich schon weitergekommen. Mit diesem Script werden Seiten dargestellt, aber keine Templates und Menus angezeigt, wenn ich zwei Rootpages einrichte.

config {

contentObjectExceptionHandler = 1

baseURL = https://localhost/vws-f1/

absRelPath = /vws-f1/

tx_realurl_enable = 1

simulateStaticDocuments = 0

sys_language_uid = 0

language = de

locale_all = de_DE

htmlTag_langKey = de

}


[globalVar = GP:L = 1]
 
config.sys_language_uid = 1
 
config.language = en
 
config.locale_all = en_EN
 
config.htmlTag_langKey = en
 
[global]
 
[globalVar = GP:L = 2]
 
config.sys_language_uid = 0
 
config.language = de
 
config.locale_all = de_DE
 
config.htmlTag_langKey = de
 
[global]



page = PAGE

page {

lib.currentPageId = TEXT
lib.currentPageId.data = TSFE:id

meta{
viewport = width=device-width, initial-scale=1, maximum-scale=1
}


footerData {
20 = TEXT
20.value (

)
}

10 = FLUIDTEMPLATE

10 {



file = fileadmin/templates/content/template.html

partialRootPath = fileadmin/templates/content
layoutRootPath = fileadmin/layout

variables {

search < styles.content.get
search.select.where = colPos=3

content < styles.content.get
content.select.where = colPos=0

footer < styles.content.get
footer.select.where = colPos=2

logo < styles.content.get
logo.select.where = colPos=1



}

}




includeCSS.bootmin = fileadmin/bootstrap/css/bootstrap.min.css

includeCSS.font = https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css

includeCSS.line = fileadmin/bootstrap/css/et-line.css

includeCSS.carousel = fileadmin/bootstrap/css/owl.carousel.css

includeCSS.megamenu = fileadmin/bootstrap/css/mdf_megamenu.css

includeCSS.mega = fileadmin/bootstrap/css/mega.css

includeCSS.general = fileadmin/css/style.css

includeCSS.responsiveTable = fileadmin/css/responsive-table.css

includeCSS.facebox = fileadmin/css/facebox.css

includeJS.jquery = fileadmin/bootstrap/js/jquery-1.9.1.min.js

includeJSFooter.mdf = fileadmin/bootstrap/js/mdf_js.min.js

includeJSFooter.carousel = fileadmin/bootstrap/js/owl.carousel.min.js

includeJSFooter.gmap = fileadmin/bootstrap/js/gmap3.min.js

includeJSFooter.bootjs = fileadmin/bootstrap/js/bootstrap.min.js

includeJSFooter.facebox = fileadmin/bootstrap/js/facebox.js

}
sanktusm ·

Fehler: RealURL was not able to find the root page id for the domain "localhost" as there was more than one root page with this domain

sanktusm ·

wenn ich realurl ausschalte werden die Inhalte angezeigt. Allerdings immer noch die erste deutsche Seite für englisch und deutsch, wir kann ich erzwingen, dass der pagetree en beim Klicken auf English erscheint