---
title: "Modern Template Building"
url: "https://www.typo3.net/d/6632-modern-template-building"
source: "typo3.net"
tags: ["Allgemein","Frage"]
created: "2003-10-20"
last_reply: "2003-10-29"
replies: 3
solved: false
page: 1
pages: 1
lang: "de"
---

# Modern Template Building

Allgemein · 3 Antworten · gestartet 2003-10-20

## Eröffnungsbeitrag

**Poldi** · 2003-10-20 · [Beitrag #1](https://www.typo3.net/d/6632-modern-template-building/1)

Hallo,
ich habe gerade das Modern Template building Part1 durchgearbeitet. Leider bekomme ich im Menu nicht meine Seitenstruktur angezeigt, sondern die Vorgaben aus dem html-template. HIer mal mein Code:

# Configuring the Auto-Parser for main template:
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/
}

# 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

# Menu 1 cObject
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>
}

# Substitute the ###content### subpart with some example content:
  subparts.content = TEXT
  subparts.content.value = HELLO WORLD - CONTENT
}

# 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

Wo könnte sonst der Fehler liegen????

## Antworten

### [#2](https://www.typo3.net/d/6632-modern-template-building/2) · Michl · 2003-10-21

> Wo könnte sonst der Fehler liegen????

Der TS-Code scheint in Ordnung zu sein. In Deinem HTML-Template gibt es schon eine td mit diesem Eintrag:

```html
<td id="menu_1">
```

Gruss
Michael

### [#3](https://www.typo3.net/d/6632-modern-template-building/3) · Poldi · 2003-10-21

Hallo, danke für die Antwort.

Dieser EIntrag steht in meinem html-Template:

<td id="menu_1">

Die vorherige Übung aus dem Modern Template building tutrial, das menu durch "hello word" zu ersetzen hat auch problemlos funktioniert.

In meinem Menu steht jetzt nur "Menu-item1" etc., aber nicht die Bezeichnungen aus meiner Steitenstruktur.

VIele GRüße

Poldi

### [#4](https://www.typo3.net/d/6632-modern-template-building/4) · Unbekannter Benutzer · 2003-10-29

Hallo Poldi,

wenn sich Deine Frage noch nicht erledigt hat, vielleicht hilft Dir folgende Überlegung:

In Deinem Script versuchst Du den dynamischen Inhalt Deiner temporären Variablen 'temp.menu_1' bereits an einer Stelle in die Seite einzusetzen, wo sie noch gar nicht definiert und gefüllt ist.

Die Definitionen

# Menu 1 cObject
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>
}

solltest Du weiter nach oben verschieben, vor die Stelle, wo die Variablen zum erstenmal benutzt werden, also vor die Stelle

# Main TEMPLATE cObject for the BODY
...

Gruß, Pieter

---

Quelle: „Modern Template Building“, typo3.net, https://www.typo3.net/d/6632-modern-template-building
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
