Zum Inhalt springen

!!! Probleme mit Template Selector ->sub

Erstellt am 26. September 2003 · 7 Antworten · letzte Antwort am 5. April 2006

Tags: Frage

susanne427 ·

Hallo Ihr!
Ich habe jetzt so ziemlich alles ausprobiert, was mir einfällt, aber ich finde keine Lösung. Ich habe nach Anleitung den Template Selector aktiviert. Es funktioniert auch wunderbar mit der main-section, aber nicht mit der sub.

Erst habe ich versucht nach Modern Template Building 2+3 vorzugehen, hat aber nicht funktioniert. Und jetzt bin ich langsam am verzweifeln!

Hier mein Code:

temp.menuTop = HMENU
temp.menuTop { ...

temp.menuLeft = HMENU
temp.menuLeft { ...

temp.contentArea = TEMPLATE
temp.contentArea {
template < plugin.tx_automaketemplate_pi1
template.content.templateType = sub
template.content.defaultTemplateFileName = ct_1.html
template.relPathPrefix = fileadmin/template/sub/
template.elements >
template.elements {
HEAD.all = 1
HEAD.all.subpartMarker = DOCUMENT_HEADER
HEAD.rmTagSections = title, style

DIV.all = 1
TD.all = 1
}

workOnSubpart = contentsection
subparts {
colNormal < styles.content.get
colLeft < styles.content.getLeft
colRight < styles.content.getRight
}
}

plugin.tx_automaketemplate_pi1 {
content < plugin.tx_rlmptmplselector_pi1
content.defaultTemplateFileName = fileadmin/template/main/index.html

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

TD.all = 1
TR.all = 1
}

relPathPrefix = fileadmin/template/main/
}

temp.mainTemplate = TEMPLATE
temp.mainTemplate {
template =< plugin.tx_automaketemplate_pi1
workOnSubpart = DOCUMENT_BODY
subparts.menu_left < temp.menuLeft
subparts.menutop < temp.menuTop
subparts.content < temp.contentArea
}

temp.headTemplate = TEMPLATE
temp.headTemplate {
template =< plugin.tx_automaketemplate_pi1
workOnSubpart = DOKUMENT_HEADER
}

temp.headTemplateCA = TEMPLATE
temp.headTemplateCA {
template < temp.contentArea
workOnSubpart = DOKUMENT_HEADER
}

page = PAGE
page.typeNum = 0
page.bodyTag = <BODY rightmargin="0" bottommargin="0" leftmargin="0" topmargin="0" bgcolor="#FFFFFF">
page.stylesheet = fileadmin/template/main/style.css

page.10 < temp.mainTemplate
page.headerData.10 < temp.headTemplate
page.headerData.20 < temp.headTemplateCA
plugin.tx_rlmptmplselector_pi1.defaultTemplateFileName = index.html

Er erkennt ja die content-area. Sie steht ja dann auch nicht mehr im Quelltext, aber die Sub-Seiten will er mir einfach nicht nehmen und ich glaube, hier irgendwo einen grundlegenden Denkfehler zu haben.

Viele Grüße

Susanne

susie ·

Wichtig bei dem Sub-Temp ist, daß Du nicht eine reine Tabelle nutzt sondern auch einem body tag setzt !!

Hier mein kompetter Code:

###+ tmplselector html ( setup-field)###########

// --- SETUP TEMPLATE SELECTOR -----------------------------------------------

plugin.tx_rlmptmplselector_pi1 {
// Define the paths leading to our HTML template files
templatePathMain = fileadmin/templates/main/
templatePathSub = fileadmin/templates/sub/

// Define the filenames used as the default HTML templates
defaultTemplateFileNameMain = template_1.html
defaultTemplateFileNameSub = ct_01.html

// If there is a page having no template selected, use a template
// selected earlier in the rootline. If there is none, use the default
inheritMainTemplates = 1
inheritSubTemplates = 1
}

// --- CONFIGURE THE AUTOMAKETEMPLATE EXTENSION --------------------------

plugin.tx_automaketemplate_pi1 {

content < plugin.tx_rlmptmplselector_pi1
elements {
BODY.all = 1
BODY.all.subpartMarker = DOCUMENT_BODY

HEAD.all = 1
HEAD.all.subpartMarker = DOCUMENT_HEADER
HEAD.rmTagSections = title

TD.all = 1
DIV.all = 1
span.all = 1
}

relPathPrefix = fileadmin/templates/main/
relPathPrefix = fileadmin/template/sub/
}

// --- CREATE TS TEMPLATES FOR MAIN AND CONTENT AREA ------------------

#Main TEMPLATE cObject for the BODY
temp.headTemplate = TEMPLATE
temp.headTemplate {
template =< plugin.tx_automaketemplate_pi1
workOnSubpart = DOCUMENT_HEADER
}

temp.contentAreaTemplate = TEMPLATE
temp.contentAreaTemplate {

# Feeding the content from the Auto-parser to the TEMPLATE cObject:
template =< plugin.tx_automaketemplate_pi1

// Modify the template selector config: This is a sub template!
template.content.templateType = sub

#Select only the content between the <body>-tags
workOnSubpart = DOCUMENT_BODY
subparts.content < styles.content.get

}

temp.mainTemplate = TEMPLATE
temp.mainTemplate {

template =< plugin.tx_automaketemplate_pi1

// Modify the template selector config: This is a sub template!
template.content.templateType = main

workOnSubpart = DOCUMENT_BODY
subparts.content-normal < temp.contentAreaTemplate
}

// --- CREATE THE MAIN PAGE OBJECT -------------------------------------------

page = PAGE
page {
typeNum = 0
headerData.10 < temp.headTemplate
10 < temp.mainTemplate
}

################stop############

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

Dazu ein das template_1.html

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

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
templateType = main
</head>
body>
<table width="949" height="96%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="222" id="menu_x">&nbsp;</td>
<td width="713" valign="top" rowspan="3">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="703" id="header">&nbsp;</td>
<td width="14">&nbsp;</td>
</tr>
</table>
<table width="100%" height="100">
<tr>
<td width="80%" id="content-normal">
&nbsp;dfg
</td>
<td width="20%" id="toolbox">&nbsp;</td>
</tr>
</Table>
</td>
</tr>
<tr>
<td width="222" height="180" background="media/images/2_rote-flaeche-li.jpg" valign="top" align="top" id="boxen">&nbsp;</td>
</tr>
<tr>
<td width="222" height="60" background="media/images/2_rote-flaeche-li.jpg" valign="top" align="top">&nbsp;</td>
</tr>
</table>
/body>
</html>

################stop############

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

und für sub = ct_01.html

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

<body

<table border="1" width="100%" bgcolor="#cccccc">
<tr>
<td valign="top">
<h1>Buy PaperShredder(tm) Gizmo with
30-days money-back guarantee!</h1>
<img src="../main/images/paperwork.jpg" wid...0" alt="" align="right"/>
<p class="bodytext">Adam Seth Enos Cainan Maleleh.../p>
<p class="bodytext">Filii Ham Chus et M...</p>
</td>
<td width="20"></td>
<td width="190" valign="top">
<h1>Buy PaperShredder(tm) Gizmo with 30-days money-back guarantee!</h1>
<p class="bodytext">Adam Seth Enos Cainan Malelehel Iar...</p>
<p class="bodytext">Filii Ham Chus et Mesraim Ph...</p>
</td>
</tr>

</table>
/body>

alles klar !!!

P.S. Body tag natürlich richtig öffnen und schließen, wird leider nicht richtig dargestellt.

Gruss Su

alias7x ·

Hallo,

ich habe den Template Selector installiert und zusammen mit Main Dish & Son aus den Modern Template Buildung Tuts durchexerziert es hört nicht auf zu stottern.

Das Main Template funktioniert, aber die Content Area - ich kann machen, was ich will.
Ehrlich gesagt, ich dreh langsam durch.
Könnte da vielleicht mal jemand einen Blick darauf werfen?

Jens

// --- SET UP TEMPLATE SELECTOR -----------------------------------------------

plugin.tx_rlmptmplselector_pi1 {

      // Define the paths leading to our HTML template files
   templatePathMain = fileadmin/template/main/
   templatePathSub = fileadmin/template/sub/

      // Define the filenames used as the default HTML templates
   defaultTemplateFileNameMain = template_1.html
   defaultTemplateFileNameSub = ct_1.html

      // If there is a page having no template selected, use a template
      // selected earlier in the rootline. If there is none, use the default
    inheritMainTemplates = 1
    inheritSubTemplates = 1
}

// --- CONFIGURE THE AUTOMAKETEMPLATE EXTENSION --------------------------

plugin.tx_automaketemplate_pi1 {

  content < plugin.tx_rlmptmplselector_pi1
  elements {
    BODY.all = 1
    BODY.all.subpartMarker = DOCUMENT_BODY
 
    HEAD.all = 1
    HEAD.all.subpartMarker = DOCUMENT_HEADER
    HEAD.rmTagSections = title
 
    TD.all = 1
    DIV.all = 1
  }
 
  relPathPrefix = fileadmin/templates/main/
} 

// --- CREATE TS TEMPLATES FOR MAIN AND CONTENT AREA ------------------

temp.headTemplate = TEMPLATE
temp.headTemplate {
  template =< plugin.tx_automaketemplate_pi1
  workOnSubpart = DOCUMENT_HEADER
}

temp.mainTemplate  = TEMPLATE
temp.mainTemplate {

  template =< plugin.tx_automaketemplate_pi1

      // Modify the template selector config: This is a main template!
   template.content.templateType = main

  workOnSubpart = DOCUMENT_BODY
  subparts.content-normal < temp.contentAreaTemplate
}

temp.contentAreaTemplate = TEMPLATE
temp.contentAreaTemplate {

   template =< plugin.tx_automaketemplate_pi1

      // Modify the template selector config: This is a main template!
   template.content.templateType = sub

   workOnSubpart = content
   subparts.content < styles.content.get 

#   subparts.colNormal < styles.content.get
#   subparts.colBorder < styles.content.getBorder 
#   subparts.colLeft < styles.content.getLeft 
#   subparts.colRight < styles.content.getRight 
}


// --- CREATE THE MENU OBJECT -------------------------------------------

# ------------------------
# Menu 1 cObject - vertical 2-level menu
# ------------------------

temp.menu_1 = HMENU

# First level menu-object, textual
temp.menu_1.1 = TMENU
temp.menu_1.1 {
# Normal state properties
NO.allWrap = <div class="menu1-level1-no"> | </div>

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

# Second level menu-object, textual
temp.menu_1.2 = TMENU
temp.menu_1.2 {
# Normal state properties
NO.allWrap = <div class="menu1-level2-no"> | </div>

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


# ------------------------
# Menu 2 cObject - horizontal, one-level menu
# ------------------------

temp.menu_2 = HMENU
# Setting the entryLevel to be subpages to CURRENT page:
temp.menu_2.entryLevel = -1

# First level menu-object, textual
temp.menu_2.1 = TMENU
temp.menu_2.1 {
# Normal state wrapping with alternating wrap-values (see "optionSplit")
NO.allWrap = |*| <td>|</td> || <td class="oddcell">|</td>|*|

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

# ------------------------
# Path menu cObject
# ------------------------

temp.path = HMENU
# Setting the special property to "rootline" - this will produce a "Path-menu"
temp.path.special = rootline

# First level menu-object, textual
temp.path.1 = TMENU
# Wrapping value for the whole menu:
temp.path.1.wrap = Path: &nbsp; |
temp.path.1 {
# Normal state properties appending " > " to all elements but the last one.
# (See "optionSplit")
NO.allWrap = |&nbsp;&gt;&nbsp; |*||*| |
}

# 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_1### subpart with dynamic menu:
subparts.menu_1 < temp.menu_1

# Substitute the ###menu_2### subpart with dynamic menu:
subparts.menu_2 < temp.menu_2

# Substitute the ###path### subpart with dynamic path menu:
subparts.path < temp.path

}
// --- CREATE THE MAIN PAGE OBJECT -------------------------------------------
 
page = PAGE
page {
   typeNum = 0
   headerData.10 < temp.headTemplate
   10 < temp.mainTemplate
}

#####################################
alias7x ·

Ich wäre so unendlich dankbar, wenn jemand ein funktionierendes typoscript zum Modern Template Building 2+3 posten könnte. Die Beispiele von Susanne und Susi funzen bei mir nicht und ich bin nach MTB1 und MTB1+2 vorgegangen, wobei ich bei der Extension Erstellung in 2+3 ausgestiegen bin.

Unendlich dankbar, ich sags euch. Würde so gerne mal weiterkommen...

theo ·
danabanana schrieb

vielleicht blöde frage aber muss man die auto parser ext benutzen damit template selector funktioniert?

nö

danabanana ·

Danke! Es war nicht ganz klar, weil fast alle die temolate selector benutzen, haben die autoparser extension installiert. Bestimmt wegen dem tutorial.

david_h ·

Hallo zusammen,

vermutlich ist das eine sehr dumme frage, ich muss sie leider trotzdem stellen:

Ich hab im setup das TS von Susie, läuft auch wunderbar.

Frage: Was muss ich machen, damit mein Inhalt angezeigt wird? (statt dem Blindtext)