---
title: "Werde p um img nicht los"
url: "https://www.typo3.net/d/97765-werde-p-um-img-nicht-los"
source: "typo3.net"
tags: ["Backend","RTE & CKEditor","Frage"]
created: "2010-03-24"
last_reply: "2010-04-08"
replies: 1
solved: false
page: 1
pages: 1
lang: "de"
---

# Werde p um img nicht los

Backend › RTE & CKEditor · 1 Antwort · gestartet 2010-03-24

## Eröffnungsbeitrag

**eisstern** · 2010-03-24 · [Beitrag #1](https://www.typo3.net/d/97765-werde-p-um-img-nicht-los/1)

Hallo,

ich habe dass Problem, dass ich im RTE eine Bild einfüge und dieses nicht automatisch in einen p gehüllt werden soll.
Ich weiß, dass es für BE sowie FE eine separate Einstellung ist, nur habe ich sie noch nicht gefunden.

Bisher habe ich folgendes:

```typoscript
RTE.default.proc.allowTagsOutside = img,hr,div
RTE.default.FE.proc < RTE.default.proc
```

Wie gesagt, wird das Bild aber trotzdem in p gepackt. Was muss ich einstellen, um dies zu verhindern?

## Antworten

### [#2](https://www.typo3.net/d/97765-werde-p-um-img-nicht-los/2) · AWX-Zweistein · 2010-04-08

Im Prinzip habe ich das gleiche Problem, da ich manchmal ein Bild innerhalb eines <p>-Tags haben will und manchmal nicht.
alle Tags um ein <img> entfernen habe ich hinbekommen, allerdings will ich das nicht immer:

<p><img /></p> -->will ich nicht es soll <img /> werden
<p><img />Text mit Wörtern</p> --> will ich zulassen

in der TS-config:

```typoscript
RTE.default.proc {
       # tags die erlaubt / verboten sind
       allowTags = table, tbody, tr, th, td, h1, h2, h3, h4, h5, h6, div, p, br, span, ul, ol, li, re, blockquote, strong, em, b, i, u, sub, sup, strike, a, img, nobr, hr, tt, q, cite, abbr, acronym, center, dl, dt, dd
       denyTags = font
       # br wird nicht zu p konvertiert
       dontConvBRtoParagraph = 1

       # tags sind erlaubt außerhalt von p, div
       allowTagsOutside = img, hr
}
```

und im Setup steht u.a. folgendes:

```typoscript
##wichtig, damit die nicht in p gewrappt werden
lib.parseFunc_RTE.externalBlocks = table, blockquote, ol, ul, hr, img, dl
lib.parseFunc_RTE.externalBlocks.hr.stripNL = 1

# rte bullet list conf with additional parsing of bulletlists
 tt_content.text.20.parseFunc {
    # Regelt was NICHT in P-tags gewrappt wird...
    externalBlocks = h1, h2, h3, p, ul, ol, dl, div, table, img
        #verhindert dass um die <ul> und <ol> tags <p>&nbsp;</p> ausgegeben wird
    externalBlocks.dl.stripNL = 1
    externalBlocks.ol.stripNL = 1
    externalBlocks.ul.stripNL = 1
    externalBlocks.h1.stripNL = 1
    externalBlocks.h2.stripNL = 1
    externalBlocks.h3.stripNL = 1
    externalBlocks.h4.stripNL = 1
    externalBlocks.img.stripNL = 1
       nonTypoTagStdWrap.textStyle.altWrap = |   }
```

mit dem Typoscript im Setup lösche ich aber knallhart alle Tags, die das <img> umschließen... will ich aber wie gesagt nicht...

meine TS-config Anweisung (allowTagsOutside = img, hr) scheint hinfällig...

Hab ich da irgendwie den falschen Ansatz?

gruß
Eric

---

Quelle: „Werde p um img nicht los“, typo3.net, https://www.typo3.net/d/97765-werde-p-um-img-nicht-los
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
