---
title: "Browserweiche f. CSS Layout in Template od. Setup?"
url: "https://www.typo3.net/d/21871-browserweiche-f-css-layout-in-template-od-setup"
source: "typo3.net"
tags: ["Allgemein","Frage"]
created: "2005-03-01"
last_reply: "2005-03-01"
replies: 2
solved: false
page: 1
pages: 1
lang: "de"
---

# Browserweiche f. CSS Layout in Template od. Setup?

Allgemein · 2 Antworten · gestartet 2005-03-01

## Eröffnungsbeitrag

**alias7x** · 2005-03-01 · [Beitrag #1](https://www.typo3.net/d/21871-browserweiche-f-css-layout-in-template-od-setup/1)

Hallo!
Zurück zu den Anfängerfragen. Ich steh gerade völlig auf dem Schlauch. Ich habe mein erstes reines CSS layout produziert und jetzt sieht das natürlich im IE anders aus als im Firefox. Und ich komme einfach nicht drauf, wie ich T3 für ne Browserweiche konfiguriere. Ich steig nicht durch.
Ich verwende kein TemplaVoila, sondern den Template Selector.

Ich habe das Stylesheet im CSS Template direkt eingebunden, als Ergebnis schaut mein HTML Output im Head folgendermaßen aus:

```php
<STYLE title=currentStyle type=text/css>@import url( fileadmin/templates/e2/main//res/e2_basic.css );</STYLE>
<link href="fileadmin/templates/e2/main/res/e2_basic.css" rel="stylesheet" type="text/css">
         
<script type="text/javascript">
<!-- if(navigator.appVersion.indexOf("MSIE 6")>-1) document.write('<link rel="Stylesheet" href="fileadmin/templates/e2/main/res/ie6.css" type="text/css" />') //-->
</script>

	<title>Büro E2: Intro</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>
```

Wie bekomme ich da Ordnung rein, und vor allem: Was muss ich machen, damit es auch funktioniert? Momentan hat nämlich das ie6.css-Stylesheet überhaupt keine Wirkung, überschreibt nix.

Die Konfiguration des Template Selectors lautet:

```typoscript
#########################################
## SET UP TEMPLATE SELECTOR 
#########################################

plugin.tx_rlmptmplselector_pi1 {

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

## Define the filenames used as the default HTML templates
defaultTemplateFileNameMain = e2_default.htm
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

## Template type. Default is "main". Allowed values: "main", "sub"
templateType = main

## Refers to the default template object to use
## if no value is set for the current page
defaultTemplateObjectMain = 10
defaultTemplateObjectSub = 10

}

#########################################
## 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/e2/main/
}


#########################################
## CREATE TS TEMPLATES FOR MAIN AND CONTENT AREA 
#########################################

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

temp.contentAreaTemplate = TEMPLATE
temp.contentAreaTemplate {

  template =< plugin.tx_automaketemplate_pi1

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

  workOnSubpart = DOCUMENT_BODY
  subparts {
    colLeft < styles.content.getLeft
    colNormal < styles.content.get
    colRight < styles.content.getRight
    colBorder < styles.content.getBorder
  }
}
```

etc.

Kann mir da jemand einen Tipp geben? (Außer den, die Suche zu benutzen, hab ich schon, komme trotzdem nicht weiter)

Danke, Gruß,
Jens

## Antworten

### [#2](https://www.typo3.net/d/21871-browserweiche-f-css-layout-in-template-od-setup/2) · theo · 2005-03-01

siehe "conditions" in der ts-referenz

### [#3](https://www.typo3.net/d/21871-browserweiche-f-css-layout-in-template-od-setup/3) · alias7x · 2005-03-01

Danke, Conditions war das richtige Stichwort. Super! Wenn man das Stichwort kennt, ist es eigentlich ganz einfach:

```typoscript
page.10.template.file = fileadmin/msie_template.html
[browser = netscape]
page.10.template.file = fileadmin/netscape_template.html
[browser = handheld]
page.10.template.file = fileadmin/handheld_template.html
[global]
```

Gruß,
Jens

---

Quelle: „Browserweiche f. CSS Layout in Template od. Setup?“, typo3.net, https://www.typo3.net/d/21871-browserweiche-f-css-layout-in-template-od-setup
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
