Zum Inhalt springen

Layoutauswahl Fluid

Erstellt am 21. August 2013 · 5 Antworten · letzte Antwort am 23. August 2013

Tags: Frage

Cremefresh76 ·

Hallo Zusammen,

ich habe ein Problem bei der Layoutauswahl mit Fluid. Sobald ich diese hinzufüge verschwindet alles innerhalb des Body-Tags im Frontend (siehe Typoscript-Code).

FluidTemplate = FLUIDTEMPLATE
FluidTemplate {

  layoutRootPath = fileadmin/templates/Private/Layouts/
  partialRootPath = fileadmin/templates/Private/Partials/  
  variables {    
    language_menu < language_menu
    logo < logo
    navigation < navigation
    navigation_right < navigation_right
    copyright < copyright
    metanavigation < metanavigation
    content_center < styles.content.get
    content_center.select.where = colPos = 0
    content_left < styles.content.get
    content_left.select.where = colPos = 1
    content_right < styles.content.get
    content_right.select.where = colPos = 2
  }
}




LayoutAuswahl = CASE
LayoutAuswahl {
  key.data = levelfield:-1, backend_layout_next_level, slide
  key.override.field = backend_layout
  default = TEXT
  default.value = Bitte Layout auswählen
  1 = FluidTemplate
  1.file = fileadmin/templates/Private/Startseite.html
  2 = FluidTemplate
  2.file = fileadmin/templates/Private/2cols.html
}


page = PAGE
page {
 
  typeNum = 0
  10 < LayoutAuswahl
}

Schreibe ich einen Template-Pfad direkt in FluidTemplate, dann funktionierts (siehe folgender Typoscript-Code), doch bringt es mir leider nicht viel, denn ich muss mehrere unterschiedliche Templates verwenden.

FluidTemplate = FLUIDTEMPLATE
FluidTemplate {
  file = fileadmin/templates/Private/Startseite.html
  layoutRootPath = fileadmin/templates/Private/Layouts/
  partialRootPath = fileadmin/templates/Private/Partials/  
  variables {    
    language_menu < language_menu
    logo < logo
    navigation < navigation
    navigation_right < navigation_right
    copyright < copyright
    metanavigation < metanavigation
    content_center < styles.content.get
    content_center.select.where = colPos = 0
    content_left < styles.content.get
    content_left.select.where = colPos = 1
    content_right < styles.content.get
    content_right.select.where = colPos = 2
  }
}


page = PAGE
page {
 
  typeNum = 0
  10 < FluidTemplate
}

Ich würde mich sehr freuen, wenn mir jemand dabei helfen könnte, das Problem zu lösen. Vielen Dank schon mal für Eure Mühe.

einpraegsam.​net ·

Ich bin mir nicht ganz sicher, was du da genau machst, aber cObject werden in TypoScript immer groß geschrieben:

...
LayoutAuswahl.1 = FLUIDTEMPLATE
...
Unbekannter Benutzer ·

1 = FluidTemplate

Muss

1 < FluidTemplate

heißen... Du definierst ja kein neues Toplevel Objekt sondern willst ja deine Konfiguration "FluidTemplate" kopieren.

StefanJ ·

anbei mal ein snippet aus meiner snippet db: vll hilft dir das ein wenig 🙂

page = PAGE
page {
	typeNum = 0
  
  	#Shortcut
  	shortcutIcon = fileadmin/favicon.ico 

  	10 = FLUIDTEMPLATE
  	10 {
  		#file = fileadmin/templates/default/htmlTemplates/layouts/main.html
    	partialRootPath = fileadmin/templates/default/htmlTemplates/partials/
    	layoutRootPath = fileadmin/templates/default/htmlTemplates/layouts/
    	variables {
    	}
  	}
}


# Assign the Template files with the Fluid Backend-Template
page.10.file.stdWrap.cObject = CASE
page.10.file.stdWrap.cObject {
  	key.data = levelfield:-1, backend_layout_next_level, slide
  	key.override.field = backend_layout

    # Set the default Template, our 2 column Template
  	2 = TEXT
  	2.value = fileadmin/templates/default/htmlTemplates/layouts/spalten-2.html

  	# Set the default Template, our standard Template
  	default = TEXT
  	default.value = fileadmin/templates/default/htmlTemplates/layouts/main.html

}