Zum Inhalt springen

Automaketemplate

Erstellt am 3. September 2003 · 8 Antworten · letzte Antwort am 4. September 2003

Tags: Frage

Lord ·

Hallo Community!

Habe mal wieder ein Problem, diesmal mit dem pi_automaketemplate.
Kennt sich jemand damit aus?

Also ich habe mir ein Template erstellt, ein ganz simples, menü links content rechts, banner oben, alles mit tabellen keine frames.

Nun wollte ich einfach, der übersichthalber, das menü in zwei teilen erstellen d.h.

Überschrift
...
...
...
Überschrift
...
...
...

Die Punkte bedeuten immer das hier belieb viele menüpunkte kommen sollen, allerdings scheitere ich hier noch nicht am typoscript sondern einfach daran, dass ich seit dem hinzufügen von diesen überschriftzellen nichtmal mehr das einfach dargestellte menü geladen wird.

Ich weiss echt nicht mehr weiter hab schon alles versucht.

Anbei häng ich noch den html code und mein setup-feld:

           ##### Configuring the Auto-Parser:####
plugin.tx_automaketemplate_pi1 {
#Read the template file
content=FILE
content.file = fileadmin/template/main/template_1.html

#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
#TD.all =1
}
#Prefix all relative paths with this value:
relPathPrefix = fileadmin/template/main/
}
                                 ####END AUTO PARSER####



                                         ####MENÜ####
#Menu1 cObject
temp.menu_1 = HMENU
temp.menu_1.1 = TMENU
temp.menu_1.1 {

#normal state properties
NO.allWrap = <div class="menu1-level1-no"><br>|</div>

#Enable active state and set properties
ACT=1
ACT.allWrap = <div class="menu1-level1-act"><br>|</div>
}

#Second level menu-object, textual

temp.menu_1.2 =TMENU
temp.menu_1.2{

#normal state
NO.allWrap= <div class="menu1-level2-no">|</div>

#Enable active state and set properties
ACT=1
ACT.allWrap = <div class="menu2-level1-act">|</div>
}
                                         ####MENÜ####


                                      ####BODY SETUP####
#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
workOnSubpart = DOCUMENT
#Änderungen für das MENÜ#

subparts.menu_1 < temp.menu_1

#Substitute the ###content### subpart with some example content:

subparts.content < styles.content.get

subparts.login < styles.content.getLeft
}
                                  ####END BODY SETUP####






                                    ####HEAD SETUP####
# Main TEMPLATE cObject for 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
}
                               ####END HEAD SETUP####




# Default PAGE object:
page = PAGE
page.typeNum = 0
#page.bodyTag=<bgcolor="#EEEEEE">
#page.bodyTag = <body bgcolor="black">
#page.bodyTag = <body bgcolor="C0C0C0">



# 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
<html>
<!-- HEADER -->
<head>
<title>www..de</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<style type="text/css" id="internalStyle">
</style>
<link href="res/stylesheet.css" rel="stylesheet" type="text/css" />
</head>
<!-- HEADER END -->





<!-- Seitenanfang -->
<body>
<table width="800" border="0" cellpadding="0" cellspacing="0">




<!-- Header image row: -->
<tr>
<td colspan="2" id="header_1" width="800" valign="top"><img src="images/bannertn.jpg" width="800" height="100" alt="" border="0" />
</td>
</tr>
<!-- Header image row: END -->


<!-- zwei leerzeilen abstand zum menü -->
<br>
<br>
<!-------------------------------------------------------->




<!-- Menu table cell: -->
<tr>
<td width="195" bgcolor="#00008b"><font color="white">Login</font></td>
<!-- Menu table cell: END -->



<!-- Page Content Area table cell: -->
<td rowspan="6" id="content">
</td>
</tr>
<!-- Page Content Area table cell: END -->




<!-- Menü -->
<tr>
<td width="195" id="login"></td>
</tr>
<tr>
<td width="195" bgcolor="#00008b"><font color="white">Hauptmen&uuml;</font></td>
</tr>
<tr>
<td width="195" id="menu_1"></td>
</tr>
<tr>
<td width="195" bgcolor="#00008b"><font color="white">Infos</font></td>
</tr>
<tr>
<td width="195" id="menu_2"></td>
</tr>
<!-- Menü END -->




<!-- Footer row: -->
<tr>
<td colspan="2" width="800" id="footer">
<br>
<br>
<p>www..de</p>
</td>
</tr>
<!-- Footer row: END -->







</table>
</body>
<!-- Seitenende -->

</html>

Wäre wirklich sehr nett wenn mir jemand helfen könnte!!!
Bitte auch bescheid sagen wenn ich im Falschen Thema gelandet bin.

MfG

Andreas W.

tmallee ·

Hi,

1. im Autoparser Conf TD.all=1 auskommentieren
2. im Main Template workOnSubpart=DOCUMENT_BODY korrekt einsetzen

Hier ist Dein Templatecode:

page = PAGE 
page.typeNum = 0 

plugin.tx_automaketemplate_pi1 { 
#Read the template file 
  content=FILE 
  content.file = fileadmin/testsuite/demo.txt 

  elements{ 
    BODY.all=1 
    BODY.all.subpartMarker = DOCUMENT_BODY 
    HEAD.all=1 
    HEAD.all.subpartMarker = DOCUMENT_HEADER 
    HEAD.rmTagSections = title 
    TD.all =1 
  }  

  relPathPrefix = fileadmin/template/main/ 
} 
  
  
#Menu1 cObject 
temp.menu_1 = HMENU 
temp.menu_1.1 = TMENU 
temp.menu_1.1 { 

  #normal state properties 
  NO.allWrap = <div class="menu1-level1-no"><br>|</div> 

  #Enable active state and set properties 
  ACT=1 
  ACT.allWrap = <div class="menu1-level1-act"><br>|</div> 
} 

#Second level menu-object, textual 

temp.menu_1.2 =TMENU 
temp.menu_1.2{ 

  #normal state  
  NO.allWrap= <div class="menu1-level2-no">|</div> 

  #Enable active state and set properties 
  ACT=1 
  ACT.allWrap = <div class="menu2-level1-act">|</div> 
} 


#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 
 
  #Änderungen für das MENÜ# 
  subparts.menu_1 < temp.menu_1 

  # content ("Normal")
  subparts.content < styles.content.get 
  
  # login
  subparts.login < styles.content.getLeft 
} 


# Main TEMPLATE cObject for 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 

# sinnlos! menu soll nicht im <head> Container stehen!
#subparts.neu1 < temp.menu1
} 
                               ####END HEAD SETUP#### 




# Default PAGE object: 


# 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

Das Problem des Menüs lag prinzipiell im HTML Code. Grds. muss jede Zelle einen Inhalt haben, und wenn es nur ein &nbsp; ist. Konstrukte wie <td id="lala"></td> werden vom Parser nicht ersetzt. Dagegen sowas wie <td id="lala">&nbsp;</td> problemlos. Noch ein Hinweis: Vermeide in HTML grds.

<br>

in <td> zum Aufzeihen eiuner Zell. Verwende besser ein blind.gif oder ein clear.gif mit entsprechender Höhenangabe. Du verwendest in Deiner Designvorlage mal sowas:

....
</tr>
<br>
<br>
<tr>
.....

Das ist ziemlich schlecht, da in HTML so verboten.

Besser:

....
</tr>
<tr>
  <td><img src="images/clear.gif" width="1" height="15" border="0" alt="">
  </td>
</tr>
<tr>
.....

Hier der HTML Code:

<html> 
<!-- HEADER --> 
<head> 
<title>www..de</title> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/> 
<style type="text/css" id="internalStyle"> 
</style> 
<link href="res/stylesheet.css" rel="stylesheet" type="text/css" /> 
</head> 
<!-- HEADER END --> 





<!-- Seitenanfang --> 
<body> 
<table width="800" border="0" cellpadding="0" cellspacing="0"> 




<!-- Header image row: --> 
<tr> 
<td colspan="2" id="header_1" width="800" valign="top"><img src="images/bannertn.jpg" width="800" height="100" alt="" border="0" /> 
</td> 
</tr> 
<!-- Header image row: END --> 


<!-- zwei leerzeilen abstand zum menü --> 
<br> 
<br> 
<!--------------------------------------------------------> 




<!-- Menu table cell: --> 
<tr> 
<td width="195" bgcolor="#00008b"><font color="white">Login</font></td> 
<!-- Menu table cell: END --> 



<!-- Page Content Area table cell: --> 
<td rowspan="6" id="content"> 
</td> 
</tr> 
<!-- Page Content Area table cell: END --> 




<!-- Menü --> 
<tr> 
<td width="195" id="login">&nbsp;</td> 
</tr> 
<tr> 
<td width="195" bgcolor="#00008b"><font color="white">Hauptmen&uuml;</font></td> 
</tr> 
<tr> 
<td width="195" id="menu_1">&nbsp;</td> 
</tr> 
<tr> 
<td width="195" bgcolor="#00008b"><font color="white">Infos</font></td> 
</tr> 
<tr> 
<td width="195" id="menu_2">&nbsp;</td> 
</tr> 
<!-- Menü END --> 




<!-- Footer row: --> 
<tr> 
<td colspan="2" width="800" id="footer"> 
<br> 
<br> 
<p>www..de</p> 
</td> 
</tr> 
<!-- Footer row: END --> 







</table> 
</body> 
<!-- Seitenende --> 

</html>

Lief bei mir einwandfrei.

Viele Grüsse

Thomas

Lord ·

Danke erst einmal für die schnelle Antwort und Danke das Du dich damit so befasst hast und es geteste hast, aber eins versteh ich nicht so ganz,

2. im Main Template workOnSubpart=DOCUMENT_BODY korrekt einsetzen

Was meinst Du damit???
Wo muss das rein oder was muss ich ändern?

Danke, Gruss

tmallee ·

Du hattest da

workOnSubpart=DOCUMENT

drin stehen. Kann aber nicht gehen, da dú im autoparserconfig DOCUMENT_BODY definiert hast.

Gruss

Thomas

Lord ·

Wunderbar!!

Es klappt ohne Probleme!!
Jetzt kann ich mich dann dran versuchen das Menü zu unterteilen, sollte eigentlich kein problem sein, oder??

Am bestens wird es wohl sein wenn ich das nach PID´s mache, oder??

Gibts da irgendwo schon ein HMENU code der sowas enthält??

MfG & Dank

tmallee ·

ja, das wäre eine Möglichkeit. Es gibt in HMENU oder TMENU die Möglichkeit, über das special Attribut nur bestimmte pid's in einem MEnü darzustellen. Weiss das nötige TS aber nicht auswendig. Schau einfach mal in der TSref auf typo3.org nach.

Grüsse

Thomas

Lord ·

So, also das mit dem special und special.value hat
bestens funktioniert, allerdings versteh ich nicht so ganz, warum mir z.B. das Gästebuch Plug-In die ganze Tabelle zerlegt ?!?!

Die zellen vom Menp werden manchmal ganz groß (hoch)
und manchmal ganz lang (breit) obwohl ich eigentlich im Template den zellen eine bestimmte größe zugeordnet hab... ?!? Kann mir das jemand erklären???

Danke schonmal!

tmallee ·

Bei dem Gästebuch kann ich dir nicht helfen, da ich dises Plugin nicht einsetze. Du solltest diese Frage besser im Forum für das Gästebuchplugin stellen, da bekommst Du sicher eher Antworten.

Gruss

Thomas

Lord ·

ok! Werde ich versuchen, hab das nur hier mal gepostet weil es eigentlich bei allein plug ins irgendeine veränderung der zellengröße gibts und ich gar nicht weiss wie das passieren kann, war immer der meinung das die module keinen einfluss darauf haben ?!?

Was muss ich denn machen damit die zellen fest bleiben??

Mir geht es hierbei rein um die Menü zellen

Der contet geht ja in die große zelle die einen rowspan macht.