Zum Inhalt springen

Typo3 baut Template nicht ein ! Wo ist Fehler ?

Erstellt am 25. Mai 2005 · 15 Antworten · letzte Antwort am 27. Mai 2005

Tags: Templates & Layouts, Frage

mwwallis ·

Hallo !

Ich hab folgendes Tenplate gebastelt:

(bissel unsortiert, da er mit dem HMTLKit erstellt wurde)

<body>

<table border="1" cellpadding="0" cellspacing="0" width="800" height="600" bgcolor="#ffffff">
 <tr>
  <td colspan="2">
   <table border="1" cellpadding="0" cellspacing="0">
		<tr id="zeile1">
			<td>
		   1
		  </td>
			<td rowspan="3">
			 egnite Logo
			</td>
	    <td>
			 Spacer
			</td>
			<td colspan="4" align="right">
			 <!--###menu_2### begin -->
			 <!--###menu_2### end -->
			</td>
		</tr>
		<tr id="zeile2">
		  <td rowspan="2">
			 1
			</td>
			<td rowspan="2">
			 Spacer
			</td>
			<td>
       <!--###menu_1### begin -->
			 <!--###menu_1### end -->
			</td>
			<td>
			 Spacer
			</td>
		</tr>
		<tr id="zeile3">
			<td colspan="2">
			 Spacer
			</td>
		</tr>
   </table>
  </td>
 </tr><tr>
  <td valign="top" width="200">
   <table border="0" cellpadding="10" cellspacing="0">
    <tr>
     <td>
		  <!--###menu_3### begin -->
			<!--###menu_3### end -->
     </td>
    </tr>
   </table>
  </td>
  <td valign="top" bgcolor="#FFFFFF">
   <table border="0" cellpadding="10" cellspacing="0">
    <tr>
		 <tr>
		   <!--###rootline### -->
		 </tr>
     <td>
			 Hier steht dan nspäter der content_1 !
     </td>
    </tr>
   </table>
  </td>
 </tr>
</table>

</body>

Das passende TypoScript (ohne GMENU) sieht so aus:

# Configuring the Auto-Parser for main template:
plugin.tx_automaketemplate_pi1 {
    # Read the template file:
  content = FILE
  content.file = fileadmin/egnite/test2.html     # TEMPLATE FILE
 
    # Here we define which elements in the HTML that 
    # should be wrapped in subpart-comments:
  elements {
    BODY.all = 1
    BODY.all.subpartMarker = DOCUMENT_BODY
 
    HEAD.all = 1
    HEAD.all.subpartMarker = DOCUMENT_HEADER
    HEAD.rmTagSections = title

    CONTENT.all = 1
    CONTENT.all.subpartMarker = CONTENT_1
 
    TD.all = 1
  }
 
    # Prefix all relative paths with this value:
  relPathPrefix = fileadmin/egnite/
}
 
 
# Main TEMPLATE cObject for the BODY
temp.mainTemplate = TEMPLATE
temp.mainTemplate {
    # Feeding the content from the Auto-parser to the TEMPLATE cObject:
  template =< plugin.tx_automaketemplate_pi1
    # Select only the content between the <body>-tags
  workOnSubpart = DOCUMENT_BODY
 

    # Substitute the ###menu_x### subpart with dynamic menu:
  subparts.menu_1 < temp.menu_1
  subparts.menu_2 < temp.menu_2
  subparts.menu_3 < temp.menu_3
  subparts.submenu < temp.submenu
  subparts.rootline < temp.rootline
  subparts.content_1 < temp.content_1

    # Substitute the ###content### subpart with some example content:
    subparts.content < styles.content.get

}
 
 
# Main TEMPLATE cObject for the HEAD
temp.headTemplate = TEMPLATE
temp.headTemplate {
    # Feeding the content from the Auto-parser to the TEMPLATE cObject:
  template =< plugin.tx_automaketemplate_pi1
    # Select only the content between the <head>-tags
  workOnSubpart = DOCUMENT_HEADER
}
 
 

# Default PAGE object:
page = PAGE
page.typeNum = 0
 
# Copying the content from TEMPLATE for <body>-section:
page.10 < temp.mainTemplate
 
# Copying the content from TEMPLATE for <head>-section:
page.headerData.10  < temp.headTemplate

Doch warum zeigt er mir wenn ich auf "ansehen" klicke nicht die Website an ? Weisses Bild... und im Quelltext steht nur der vom Typo3 selber. Also ohne meine Tabelle.

Hat einer eine Hilfe für mich ? Danke !!!

Gruss aus Bochum...
WALLis

Zwi ·

muss man die Subparts nicht auch angeben (im html)?

oder erreichst du mit DOCUMENT_BODY automatisch den Body?

mwwallis ·

Hmm... Gute Frage !

Bin nur Laie...

Wie sollte das denn dann aussehen ?

Der Quelltext der von Typo3 erstellten Seite sieht übrigens so aus:

<!DOCTYPE html
	PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<!-- 
	This website is brought to you by TYPO3 - get.content.right
	TYPO3 is a free open source Content Management Framework created by Kasper Skaarhoj and licensed under GNU/GPL.
	TYPO3 is copyright 1998-2004 of Kasper Skaarhoj. Extensions are copyright of their respective owners.
	Information and contribution at http://www.typo3.com
-->


	<title>E***** Software GmbH: E*****.de - Software GmbH</title>
	<meta name="generator" content="TYPO3 3.7 CMS" />
	<script type="text/javascript">
		/*<![CDATA[*/
	<!--
		browserName = navigator.appName;
		browserVer = parseInt(navigator.appVersion);
		var msie4 = (browserName == "Microsoft Internet Explorer" && browserVer >= 4);
		if ((browserName == "Netscape" && browserVer >= 3) || msie4 || browserName=="Konqueror") {version = "n3";} else {version = "n2";}
			// Blurring links:
		function blurLink(theObject)	{	//
			if (msie4)	{theObject.blur();}
		}
		
	// -->
		/*]]>*/
	</script>


</head>
<body bgcolor="#FFFFFF">

</body>
</html>
Zwi ·

mein Template:

...
</head>
<!-- ###DOKUMENT### begin -->
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">

...<hier kommen="" dann="" meine="" marker="">
<tr>
Bsp. <td>###TEASER2###</td>
</tr>

</table>
<!-- ###DOKUMENT### end -->
</body>

</html>

im Page Setup sieht das dann so aus:

...
seite = PAGE
seite {
 typeNum = 1
...
10 < styles.content.get
10 = TEMPLATE
10.template = FILE
10.template.file = {$template}
10.workOnSubpart = DOKUMENT
10.marks {
... 
 TEASER2 = CONTENT
 TEASER2 {
 table = tt_content
 select.orderBy = sorting
 select.where = colPos = 3
 }
}

also da wo meist 3 Punkte stehen kommt natürlich noch etwas code rein...aber die wichtigsten Punkte die für dich relevant sind hab ich mal aufgeführt!

Zwi ·

beachte besonders

10.workOnSubpart = DOKUMENT

und

<!-- ###DOKUMENT### begin -->

mwwallis ·

Aber ich habe genau das gleichen Typo3 Script mit folgendem Template (komplette Datei) zum laufen bekommen, zum testen der GMenus.

<body>

<table name="header_menu1" border="1" cellpadding="0" cellspacing="0">
			 <tr>
			 		 <td>
					 <!--###menu_2### begin -->
					 <!--###menu_2### end -->
					 <td/>
			</tr>
</table>


<table name="header_menu2" border="1" cellpadding="0" cellspacing="0">
			<tr>
			 		 <td>
					 <!--###menu_1### begin -->
					 <!--###menu_1### end -->
					 </td>
			</tr>
</table>

<hr color="green">


<table name="menu_content" border="1" cellpadding="0" cellspacing="0">
			 <tr>
			 		 <td>
					 <!--###menu_3### begin -->
					 <!--###menu_3### end -->
					 </td>
			 </tr>
			 <tr>
					 <td id="content">
			 		 <!--###content_1### begin -->
					 <!--###content_1### end -->
			 		 </td>
			 </tr>
</table>

</body>
</html>
Zwi ·

ich habe aber im html
<!-- ###DOKUMENT### begin -->

und dazwischen meinen
###TEASER###

<!-- ###DOKUMENT### end -->

Zwi ·

und wie sagst du ihm das er zwischen dem begin+end was einfügt??

ich mach das über den marker!!

Zwi ·

sind das nicht Subparts????
<!--###menu_2### begin -->
<!--###menu_2### end -->

mwwallis ·

Ja.... aber bei dem anderen Template ging das ja, bei genau dem gleichen TypoScript.

Hier nochmal das HTML-File:

   1.
      <body>
   2.
       
   3.
      <table name="header_menu1" border="1" cellpadding="0" cellspacing="0">
   4.
                               <tr>
   5.
                                              <td>
   6.
                                               <!--###menu_2### begin -->
   7.
                                               <!--###menu_2### end -->
   8.
                                               <td/>
   9.
                              </tr>
  10.
      </table>
  11.
       
  12.
       
  13.
      <table name="header_menu2" border="1" cellpadding="0" cellspacing="0">
  14.
                              <tr>
  15.
                                              <td>
  16.
                                               <!--###menu_1### begin -->
  17.
                                               <!--###menu_1### end -->
  18.
                                               </td>
  19.
                              </tr>
  20.
      </table>
  21.
       
  22.
      <hr color="green">
  23.
       
  24.
       
  25.
      <table name="menu_content" border="1" cellpadding="0" cellspacing="0">
  26.
                               <tr>
  27.
                                              <td>
  28.
                                               <!--###menu_3### begin -->
  29.
                                               <!--###menu_3### end -->
  30.
                                               </td>
  31.
                               </tr>
  32.
                               <tr>
  33.
                                               <td id="content">
  34.
                                              <!--###content_1### begin -->
  35.
                                               <!--###content_1### end -->
  36.
                                              </td>
  37.
                               </tr>
  38.
      </table>
  39.
       
  40.
      </body>
  41.
      </html>
mwwallis ·

Jetzt zeigt er mir zwar die Website an, aber meine Menüs nicht mehr. Wie bekomme ich denn jetzt die GMENUs wieder eingeblendet ?

Hier der Aktuelle Template Code:

 # Menu 1
temp.menu_1 = HMENU
temp.menu_1.special = directory
temp.menu_1.special.value = 48    # Legt die Unterseiten des Menus fest seitenid=48

  # Menu Ebene 1
temp.menu_1.1 = GMENU
temp.menu_1.1 {
  NO = 1
  NO {
    XY = 100, 25
    wrap = <td>|</td>
  10 = TEXT
  10.text.field = title
  10.fontColor = black
  10.fontFile = fileadmin/egnite/font/menu.ttf
  10.offset = 5, 15 
}
}


 # Menu2
temp.menu_2 = HMENU
temp.menu_2.special = directory
temp.menu_2.special.value = 49    # Legt die Unterseiten des Menus seitenfest id=49

  # Menu Ebene 1
temp.menu_2.1 = GMENU
temp.menu_2.1 {
  NO = 1
  NO {
    XY = 100, 25
    wrap = <td>|</td>
    10 = TEXT
    10.text.field = title
    10.fontColor = black
    10.fontFile = fileadmin/egnite/font/menu.ttf
    10.offset = 5, 15 
  }
}


 # Menu3
temp.menu_2 = HMENU
temp.menu_2.special = directory
temp.menu_2.special.value = 49    # Legt die Unterseiten des Menus seitenfest id=49

  # Menu Ebene 1
temp.menu_2.1 = GMENU
temp.menu_2.1 {
  NO = 1
  NO {
    XY = 100, 25
    wrap = <td>|</td>
    10 = TEXT
    10.text.field = title
    10.fontColor = black
    10.fontFile = fileadmin/egnite/font/menu.ttf
    10.offset = 5, 15 
  }
}



 # SubMenu
temp.submenu = HMENU
temp.submenu.entryLevel = 2
  # SubMenu Ebene 1
temp.submenu.1 = GMENU
temp.submenu.1 {
  NO = 1
  NO {
    XY = 100, 25
    wrap = <br>|</br>
  10 = TEXT
  10.text.field = title
  10.fontColor = black
  10.fontFile = fileadmin/egnite/font/menu.ttf
  10.offset = 5, 15 
}
}
temp.submenu.2 = GMENU
temp.submenu.2 {
  NO = 1
  NO {
    XY = 100, 25
    wrap = <br>|</br>
  10 = TEXT
  10.text.field = title
  10.fontColor = black
  10.fontFile = fileadmin/egnite/font/menu.ttf
  10.offset = 5, 15 
}
}


page.2 = HMENU
page.2.special = rootline
page.2.special.range = 2|-1
page.2.special.targets.3 = page
page.2.1 = TMENU
page.2.1.target = _top
page.2.1.wrap = | 
page.2.1.NO {
linkWrap = | >
}



##########################################################################

# AutoParser Konfiguirieren
plugin.tx_automaketemplate_pi1 {
  # Templatefile auslesen
  content = FILE
  ontent.file = fileadmin/egnite/test2.html

    # Prefix all relative paths with this value:
  relPathPrefix = fileadmin/egnite/
}
 
# SupParts ansprechen
page = PAGE
page.typeNum = 0
page.10 = TEMPLATE
page.10 {
  template = FILE
  template.file = fileadmin/egnite/test2.html
  workOnSubpart = DOKUMENT
}

# TEMPLATE fur den BODY BEREICH
temp.mainTemplate = TEMPLATE
temp.mainTemplate {
  template =< plugin.tx_automaketemplate_pi1

  # Nimmt alles zwischen den <body>-Tags
  workOnSubpart = DOKUMENT_BODY

# Ersetzen der Subparts durch Dynamischen Inhalt
  subparts.menu_1 < temp.menu_1
  subparts.menu_2 < temp.menu_2
  subparts.menu_3 < temp.menu_3
  subparts.submenu < temp.submenu
  subparts.rootline < temp.rootline
  subparts.content_1 < temp.content_1

# Ersetzen der Subparts durch Dynamischen Content 
    subparts.content < styles.content.get

# TEMPLATE fuer den HEADER BEREICH
temp.headTemplate = TEMPLATE
temp.headTemplate {
  template =< plugin.tx_automaketemplate_pi1

  # Nimmt alles zwischen den <HEADER>-Tags
  workOnSubpart = DOKUMENT_HEADER
}

# Hauptseite laden
page = PAGE
page.typeNum = 0

# Kopieren vom Inhalt des Templates in den <BODY>-Tag
page.10 < temp.mainTemplate
# Kopieren vom Inhalt des Templates in den <HEAD>-Tag
page.headerData.10  < temp.headTemplate

Und hier der Aktuelle HTML Template Code:

<!--###DOKUMENT### begin -->

<table border="1" cellpadding="0" cellspacing="0" width="800" height="600" bgcolor="#ffffff">
 <tr>
  <td colspan="2">
   <table border="1" cellpadding="0" cellspacing="0">
		<tr id="zeile1">
			<td bgcolor="#000000">
		   ImageSpacer
		  </td>
			<td rowspan="3" bgcolor="#000000">
			 ImageFirmenlogo
			</td>
	    <td bgcolor="#000000">
			 Spacer
			</td>
			<td id="menu_2" colspan="4" bgcolor="#000000" align="right">
			 HIER SOLL MENU_2 REIN
			</td>
		</tr>
		<tr id="zeile2">
		  <td rowspan="2">
			 ImageSpacer
			</td>
			<td rowspan="2">
			 ImageSpacer
			</td>
			<td>
       HIER SOLL MENU_1 REIN
			</td>
			<td>
			 ImageSpacer
			</td>
		</tr>
		<tr id="zeile3">
			<td colspan="2">
			 ImageSpacer
			</td>
		</tr>
   </table>
  </td>
 </tr><tr>
  <td valign="top" width="200">
   <table border="0" cellpadding="10" cellspacing="0">
    <tr>
     <td>
		  HIER SOLL MENU_3 REIN
     </td>
    </tr>
   </table>
  </td>
  <td valign="top" bgcolor="#FFFFFF">
   <table border="0" cellpadding="10" cellspacing="0">
    <tr>
		 <tr>
		  ROOTLINE
		 </tr>
     <td>
			 Hier steht dan nspäter der content_1 !
     </td>
    </tr>
   </table>
  </td>
 </tr>
</table>

<!--###DOKUMENT### end -->
Zwi ·

und jetzt solltest du da wo steht
HIER SOLL MENU_1 REIN
einen Marker setzen!!
Beachte Marker ist nicht gleich Subpart!

also ###MENU_1###
bei mir ist ###MENU_1### nun NAVITOP

10.marks {
NAVITOP = HMENU 
NAVITOP.special = list
NAVITOP.special.value = 2,6,5,4,3,7
NAVITOP.1 = GMENU
NAVITOP.1.NO {
  10 = IMAGE
  XY = 125, 24
  10.file = 
....
mwwallis ·

Er macht es nicht !!!!!! #evil# #evil# #evil#
Gottverdammt... es geht nicht !

Kann nicht jemand mal meinen Typoscript editieren und verbessern und dann hier posten ???? Hier geht nix... jetzt zeigt mir das Templat an, aber da wo ich im Template den Marker gesetzt habe "###menu_1###" steht dann genau "###menu_1###" !!! Warum ???