Zum Inhalt springen

Werde p um img nicht los

Erstellt am 24. März 2010 · 1 Antwort · letzte Antwort am 8. April 2010

Tags: Frage

eisstern ·

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:

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?

AWX-Zweistein ·

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:

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:

##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