---
title: "Constants und Setup"
url: "https://www.typo3.net/d/3034-constants-und-setup"
source: "typo3.net"
tags: ["Allgemein","Frage"]
created: "2003-05-22"
last_reply: "2003-05-22"
replies: 1
solved: false
page: 1
pages: 1
lang: "de"
---

# Constants und Setup

Allgemein · 1 Antwort · gestartet 2003-05-22

## Eröffnungsbeitrag

**Kasi** · 2003-05-22 · [Beitrag #1](https://www.typo3.net/d/3034-constants-und-setup/1)

Hallo,
ich lese nun schon seit 3 Wochen alle möglichen Tutorials, TSRef usw.
Aber ich habe immer noch nicht so ganz verstanden, wann man das Constants-Feld verwendet und wann das Setup-Feld...
Mit dem Setup-Feld arbeite ich eigentlich recht gut.
Nun habe ich jedoch des öfteren gesehen, das man fast gleiche Angaben auch im Constants-Feld eingibt.
Wann wird was von den beiden für was verwendet?

Ich danke euch im Voraus für eure Hilfe...
Grüße
KASI

## Antworten

### [#2](https://www.typo3.net/d/3034-constants-und-setup/2) · flayoo · 2003-05-22

> "Constants": The "Constants-field". This is where you put constants that is substituted in the setup-field. Eg. a constant "styles.content.textStyle.size" is inserted in the setup-field as "{$styles.content.textStyle.size}". Constants are substituted in the order they are introduced in this field. It is important to understand that constants are not used as programming variables. They only substitute constants items in Setup. Note that the Constants-field is "summed-up" (concatenated) with previous templates in the rootline and constants-fields from included templates.
>
> "Setup": This field contains the TypoScript setup-code. Use constants from the "Constants-field" (3) to insert easily changable properties or global values. Note that the Setup-field is "summed-up" (concatenated) with previous templates in the rootline and Setup-fields from included templates.

Wenn du z.b. in dein ConstantFeld **bgCol = red** eingibst kannst du im SetupFeld darauf zurückgreifen

```typoscript
page = PAGE
page.typeNum = 0
 
page.bodyTag = <BODY bgColor="{$bgCol}">
```

---

Quelle: „Constants und Setup“, typo3.net, https://www.typo3.net/d/3034-constants-und-setup
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
