---
title: "lib.stdheader Icon einsetzen (css-styledContent)"
url: "https://www.typo3.net/d/119635-libstdheader-icon-einsetzen-css-styledcontent"
source: "typo3.net"
tags: ["TYPO3","TypoScript","Frage","Inhaltselemente","TYPO3 6.x"]
created: "2015-02-03"
last_reply: "2015-02-03"
replies: 2
solved: true
page: 1
pages: 1
lang: "de"
---

# lib.stdheader Icon einsetzen (css-styledContent)

TYPO3 › TypoScript · 2 Antworten · gelöst · gestartet 2015-02-03

## Frage

**danila** · 2015-02-03 · [Beitrag #1](https://www.typo3.net/d/119635-libstdheader-icon-einsetzen-css-styledcontent/1)

Hallo Forum,
ich versuche gerade ein Icon mit Fontawsome vor den Header setzen zu können. Hierfür verwende ich die Extension iconfont.
Leider funktioniert bei mit das mitgelieferte setup nicht.
Ich bin inzwischen so weit, das ich in jedem header ein Icon eingesetzt habe:

```html
<h3 class="csc-header-alignment-center csc-firstHeader">
<i class="fa fa-anchor "></i>Services</h3>
```

Funktioniert mit:

```typoscript
10 = CASE
  10.setCurrent {
    field = header
    htmlSpecialChars = 1
    typolink.parameter.field = header_link
  }
  10.key.field = header_layout
  10.key.ifEmpty = {$content.defaultHeaderType}
  10.key.ifEmpty.override.data = register: defaultHeaderType

  10.1 = TEXT
  10.1.current = 1
  10.1.dataWrap = <h1{register:headerClass}><i class="{$plugin.tx_iconfont.fontClassPrefix}{field:tx_iconfont_icon} {$plugin.tx_iconfont.fontClassAddon}"></i>|</h1>

  10.2 < .10.1
  10.2.dataWrap = <h2{register:headerClass}><i class="{$plugin.tx_iconfont.fontClassPrefix}{field:tx_iconfont_icon} {$plugin.tx_iconfont.fontClassAddon}"></i>|</h2>

  10.3 < .10.1
  10.3.dataWrap = <h3{register:headerClass}><i class="{$plugin.tx_iconfont.fontClassPrefix}{field:tx_iconfont_icon} {$plugin.tx_iconfont.fontClassAddon}"></i>|</h3>

  10.4 < .10.1
  10.4.dataWrap = <h4{register:headerClass}><i class="{$plugin.tx_iconfont.fontClassPrefix}{field:tx_iconfont_icon} {$plugin.tx_iconfont.fontClassAddon}"></i>|</h4>

  10.5 < .10.1
  10.5.dataWrap = <h5{register:headerClass}><i class="{$plugin.tx_iconfont.fontClassPrefix}{field:tx_iconfont_icon} {$plugin.tx_iconfont.fontClassAddon}"></i>|</h5>
```

Jetzt würde ich gerne den kompletten <i></i> Tag nur setzen, wenn auch aus dem Icon-Dropdown auch etwas ausgewählt ist. (key.field = tx_iconfont_icon)
Ich komm irgendwie nicht darauf, wie ich das hin bekomme.
Kann mir hier jemand weiter helfen?
LG

## Beste Antwort

**toifel** · 2015-02-03 · [Beitrag #2](https://www.typo3.net/d/119635-libstdheader-icon-einsetzen-css-styledcontent/2)

Mal so versuchen (ungetestet):

```typoscript
10.1 = COA
10.1.1 = TEXT
10.1.1.current = 1
10.1.1.dataWrap = <h1{register:headerClass}><i class="{$plugin.tx_iconfont.fontClassPrefix}{field:tx_iconfont_icon} {$plugin.tx_iconfont.fontClassAddon}"></i>|</h1>
10.1.1.if.isTrue.field = tx_iconfont_icon

10.1.2 = TEXT
10.1.2.current = 1
10.1.2.dataWrap = <h1{register:headerClass}>|</h1>
10.1.2.if.isFalse.field = tx_iconfont_icon
```

## Antworten

### [#2](https://www.typo3.net/d/119635-libstdheader-icon-einsetzen-css-styledcontent/2) · toifel · 2015-02-03 · Beste Antwort

(Text siehe oben unter „Beste Antwort“.)

### [#3](https://www.typo3.net/d/119635-libstdheader-icon-einsetzen-css-styledcontent/3) · danila · 2015-02-03

Ah cool danke so gehts auch :)
Hab raus gefunden, das bei mir das setup nicht gegriffen hat, weil ich zusätzlich noch das bootstrp_package verwende und mit das das css_styledContent überschreibt. Jetzt geht aber alles! Vielen Dank!!!!

---

Quelle: „lib.stdheader Icon einsetzen (css-styledContent)“, typo3.net, https://www.typo3.net/d/119635-libstdheader-icon-einsetzen-css-styledcontent
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
