Zum Inhalt springen

*.tmpl in Subparts und Marker in *.tmpl

Erstellt am 3. Juli 2007 · 5 Antworten · letzte Antwort am 6. Juli 2007

Tags: Templates & Layouts, TYPO3 4, Frage

Michler ·

Hallo,
bin Typo3 Anfänger und habe mich schon durch einige Foren und durch die Dokumentation gewühlt, was aber nicht zu einer Lösung meines Problems führt.

Zunächst mein TS - Code:

---------------root---------------

seite = PAGE

seite {
typNum = 0
bodyTag = <body bgColor="#5F5F5F">
stylesheet = fileadmin/css/basic.css
meta.AUTHOR = Sebastian Brauer , Livevision


10 = TEMPLATE
10.template = FILE
10.template.file = fileadmin/template/main.tmpl


10.subparts{

HEADER = TEXT
HEADER.value = {$header}

MAINCONTENT = FILE
MAINCONTENT.file = fileadmin/template/section1.tmpl

MAINCONTENT.marks.TEST = TEXT
MAINCONTENT.marks.TEST.value = Das wird nicht angezeigt

MAINMENU = HMENU
MAINMENU.special = directory
MAINMENU.special.value = 7
MAINMENU.1 = GMENU
MAINMENU.1.NO = 1
MAINMENU.1.NO{
XY = 27, 27
backColor = #000000
wrap = |<br><br>
10 = TEXT
10.text.field = title
10.fontFile = fileadmin/font/trebuc.ttf
10.fontSize = 17px
10.fontColor = white
10.offset = 8,21
}

}

}

----------------------------------------

section1.tmpl beinhaltet eine Tabelle mit dem Marker ###TEST###
section1.tmpl wird richtig eingebunden.
Der Marker ###TEST### wird jedoch nicht mit dem (wahrscheinlich falsch) zugewiesenen
Inhalt überschrieben und steht als ###TEST### im Queltext.

1. Was mache ich falsch, warum geht das so nicht ?
2. Wie könnte es funktionieren ?

Danke vorab für jede Hilfe und besonders für die Beantwortung meiner 2 Fragen .

Unbekannter Benutzer ·

Du musst MAINCONTENT den Typ TEMPLATE geben, so wie bei page.10 ...

also :

MAINCONTENT = TEMPLATE
MAINCONTENT.template = FILE
MAINCONTENT.template.file = fileadmin/template/section1.tmpl
MAINCONTENT.marks.TEST = TEXT
MAINCONTENT.marks.TEST.value = Das wird nicht angezeigt

Grüße

Christian

Michler ·

Es geht, wenn TEST vom Objekttyp TEXT ist.
Wenn TEST = CONTENT dann leider nicht.

Muss man da noch was besonderes beachten ?

Zeile: 26 - 34

seite = PAGE

seite {
	typNum = 0
	bodyTag = <body bgColor="#5F5F5F">
	stylesheet = fileadmin/css/basic.css
	meta.AUTHOR = Sebastian Brauer , Livevision 
	
	10 = TEMPLATE
	10.template = FILE
	10.template.file = fileadmin/template/main.tmpl	
	
	
	10.subparts{
	
	HEADER = TEXT
	HEADER.value = {$header}
	
		
	MAINCONTENT = TEMPLATE
	MAINCONTENT {
		
		template = FILE 
		template.file = fileadmin/template/section1.tmpl

		# Das geht ...
                # marks.TEST = TEXT
		# marks.TEST.value = Das geht

		# Folgendes geht nicht
                marks.TEST = CONTENT
		marks.TEST.table = tt_content
		marks.TEST.select.orderBy = sorting
 					
		marks.MAIN_HEADLINE = TEXT
		marks.MAIN_HEADLINE.value = {$main_headline}	
	}
	
	MAINMENU = HMENU
		MAINMENU.special = directory
		MAINMENU.special.value = 7
		MAINMENU.1 = GMENU		
		MAINMENU.1.NO = 1
		MAINMENU.1.NO{
			XY = 27, 27
			backColor = #000000
			wrap = |<br><br> 
			10 = TEXT
			10.text.field = title			
			10.fontFile = fileadmin/font/trebuc.ttf
			10.fontSize = 17px
			10.fontColor = white
			10.offset = 8,21 
			}	
	
	

	}	
}

TS steht im Root - Template .
Der Content steht im Root unter Normal.

Unbekannter Benutzer ·

Hast du ein renderObj für tt_content (sprich hast du unter include static entweder Content oder css_styled_content eingebunden?

Guck mal ob die Extension css_styled_content installiert ist, binde die unter include static ein und ersetze deine marks.TEST Zeilen durch:
marks.TEST < styles.content.get

Michler ·

Wow, Treffer, 100 Points es geht !!

Lösung:

seite = PAGE

seite {
	typNum = 0
	bodyTag = <body bgColor="#5F5F5F">
	stylesheet = fileadmin/css/basic.css
	meta.AUTHOR = Sebastian Brauer , Livevision 
	
	
	
	10 = TEMPLATE
	10.template = FILE
	10.template.file = fileadmin/template/main.tmpl	
	
	
	10.subparts{
	
	HEADER = TEXT
	HEADER.value = {$header}
	
		
	MAINCONTENT = TEMPLATE
	MAINCONTENT {
		
		template = FILE 
		template.file = fileadmin/template/section1.tmpl
		
		marks.TEST  < styles.content.get 
                
 		
 					
		marks.MAIN_HEADLINE = TEXT
		marks.MAIN_HEADLINE.value = {$main_headline}
			
	}
	
	MAINMENU = HMENU
		MAINMENU.special = directory
		MAINMENU.special.value = 7
		MAINMENU.1 = GMENU		
		MAINMENU.1.NO = 1
		MAINMENU.1.NO{
			XY = 27, 27
			backColor = #000000
			wrap = |<br><br> 
			10 = TEXT
			10.text.field = title			
			10.fontFile = fileadmin/font/trebuc.ttf
			10.fontSize = 17px
			10.fontColor = white
			10.offset = 8,21 
			}	
	
	

	}
	
	
}

und natürlich
bei typo3 4.1.1. beim Template-Modify unter "include static" die "css_styled_content" einbinden