Zum Inhalt springen

<typohead type="1"> im Frontend

Erstellt am 31. März 2007 · 1 Antwort · letzte Antwort am 1. April 2007

Tags: Frage

sven.​lauritzen ·

Hallo allerseits!

Ich benutze Typo3 4.0 mit rtehtmlarea 1.3.7, habe auch Typo3 4.0.4 mit rtehtmlarea 1.3.8 probiert. Die gesamte RTE-Konfiguration habe ich von einer Seite kopiert (auf dem gleichen Server mit gleicher Typo3-Version), bei der alles wunderbar funktioriert. Bei der neuen Seite werden jedoch statt <hx>-Tags im Frontend <typohead>-Tags ausgegeben. Im RTE sieht dagegen alles vernünftig aus. Eine Google-Recherche brachte im Wesentlichen nur hervor, dass ich bei weitem nicht der einzige bin, der dieses Problem hat. Kennt jemand Abhilfe?

Die relevanten Konfigurationsabschnitte poste ich unten.

Da ich die gesamte Konfiguration löschen kann, ohne dass sich im Frontend etwas ändert, gehe ich stark davon aus, dass die so gut wie gar nichts mit dem Problem zu tun hat. Der Parser für das Frontend scheint irgendwie separat zu sein, - und in meinem Fall sowas wie ausgeschaltet.

Gruß

Sven

Constants

content.wrap.header = |
content.defaultHeaderType = 1
content.wrap.header1 = <h1>|</h1>
content.wrap.header2 = <h2>|</h2>
content.wrap.header3 = <h3>|</h3>
content.wrap.header4 = <h4>|<h4>

Setup

lib.stdheader=COA
lib.stdheader {
  10.1 = TEXT
  10.1.current = 1
  10.1.insertData = 1
  10.1.fontTag = <h1>|</h1>

  10.2 < .10.1
  10.2.fontTag = <h2>|</h2>

  10.3 < .10.1
  10.3.fontTag = <h3>|</h3>

  10.4 < .10.1
  10.4.fontTag = <h4>|</h4>

  10.5 < .10.1
  10.5.fontTag = <h5>|</h5>

  stdWrap.dataWrap = |
}

TSConfig im Pageheader

RTE.classes {
        align-left {
                name = LLL:EXT:rtehtmlarea/htmlarea/locallang_tooltips.xml:justifyleft
                value = text-align: left;
        }
        align-center {
                name = LLL:EXT:rtehtmlarea/htmlarea/locallang_tooltips.xml:justifycenter
                value = text-align: center;
        }
        align-right {
                name = LLL:EXT:rtehtmlarea/htmlarea/locallang_tooltips.xml:justifyright
                value = text-align: right;
        }
}

RTE.classesAnchor {
        internalLink {
                class = internal-link
                type = page
                image >
        }
        externalLink {
                class = external-link
                type = url
                image >
        }
        externalLinkInNewWindow {
                class = external-link-new-window
                type = url
                image >
        }
        internalLinkInNewWindow {
                class = internal-link-new-window
                type = page
                image >
        }
        download {
                class = download
                type = file
                image >
        }
        mail {
                class = mail
                type = mail
                image >
        }
}
 
RTE.default {
 
        contentCSS = fileadmin/templates/style.css
       
        enableWordClean = 1
        removeTrailingBR = 1
        removeComments = 1
        removeTags = center, sdfield
        removeTagsAndContents = style,script
 
        showButtons = textstyle, textstylelabel, formatblock, blockstyle, blockstylelabel, bold, italic, underline, left, center, right, orderedlist, unorderedlist, insertcharacter, line, link, image, removeformat, table, toggleborders, tableproperties, rowproperties, rowinsertabove, rowinsertunder, rowdelete, rowsplit, columninsertbefore, columninsertafter, columndelete, columnsplit, cellproperties, cellinsertbefore, cellinsertafter, celldelete, cellsplit, cellmerge, findreplace, insertcharacter, undo, redo, chMode, showhelp, about
        hideButtons = fontstyle, fontsize, strikethrough,lefttoright, righttoleft, textcolor, bgcolor, textindicator, emoticon, user, spellcheck, inserttag, outdent, indent, justifyfull, subscript, superscript, acronym, copy, cut, paste
        hidePStyleItems = h4, h5, h6

        keepButtonGroupTogether = 1
 
        showStatusBar =  0
 
        inlineStyle.text-alignment (
                p.align-left, h1.align-left, h2.align-left, h3.align-left, h4.align-left, h5.align-left, h6.align-left, td.align-left { text-align: left; }
                p.align-center, h1.align-center, h2.align-center, h3.align-center, h4.align-center, h5.align-center, h6.align-center, td.align-center { text-align: center; }
                p.align-right, h1.align-right, h2.align-right, h3.align-right, h4.align-right, h5.align-right, h6.align-right, td.align-right { text-align: right; }
        )
 
        ignoreMainStyleOverride = 1
       
        proc {
                overruleMode = ts_css
                remapParagraphTag = p
                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, hr, tt, q, cite, abbr, acronym
                denyTags = font, nobr, center
 
                dontConvBRtoParagraph = 1
 
                allowTagsOutside = img,hr, ul, ol, li, h1, h2, h3, h4, h5, h6, typohead
 
                keepPDIVattribs = align,class,style,id
 
                allowedClasses (
                        external-link, external-link-new-window, internal-link, internal-link-new-window, download, mail,
                        align-left, align-center, align-right, author
                )       
 
                HTMLparser_rte {
 
                        # tags die erlaubt/verboten sind
                        allowTags < RTE.default.proc.allowTags
                        denyTags < RTE.default.proc.denyTags
 
                        # tags die untersagt sind
                        removeTags = font
 
                        # entfernt html-kommentare
                        removeComments = 1
 
                        keepNonMatchedTags = 0
                }
 
 
                entryHTMLparser_db = 1
                entryHTMLparser_db {
                        xhtml_cleaning = 1
                        allowTags < RTE.default.proc.allowTags
                        denyTags < RTE.default.proc.denyTags
 
                        noAttrib = b, i, u, strike, sub, sup, strong, em, quote, blockquote, cite, tt, br, center
 
                        rmTagIfNoAttrib = span,div,font
 
                        #htmlSpecialChars = 1
       
                        tags {
                                p.fixAttrib.align.unset >
                                p.allowedAttribs = class,style,align
 
                                div.fixAttrib.align.unset >
 
                                hr.allowedAttribs = class
 
                                b.remap = strong
                                i.remap = em

                                h1.remap = typohead type="1"
                                h2.remap = typohead type="2"
                                h3.remap = typohead type="3"
                                h4.remap = typohead type="4"
                                h5.remap = typohead type="5"
                                h6.remap = typohead type="6"
 
                                img >
                        }

                }
 
        }
 
        classesParagraph (
                align-left, align-center, align-right
        )
 
        classesCharacter = author
        classesImage= rte_image
 
 
        classesAnchor = external-link, external-link-new-window, internal-link, internal-link-new-window, download, mail
        classesAnchor.default {
                page = internal-link
                url = external-link-new-window
                file = download
                mail = mail
        }
 
        showTagFreeClasses = 1
 
        hideTags = font
 
        hideTableOperationsInToolbar = 0
        keepToggleBordersInToolbar = 1
 
        disableSpacingFieldsetInTableOperations = 1
        disableAlignmentFieldsetInTableOperations=1
        disableColorFieldsetInTableOperations=1
        disableLayoutFieldsetInTableOperations=1
        disableBordersFieldsetInTableOperations=0
}
 
RTE.default.enableWordClean.HTMLparser < RTE.default.proc.entryHTMLparser_db
 
RTE.default.FE < RTE.default
RTE.default.FE.userElements >
RTE.default.FE.userLinks >
 
TCEFORM.tt_content.bodytext.RTEfullScreenWidth= 80% 

RTE.config.tt_content.bodytext >

RTE.config.tt_content.bodytext.proc.overruleMode = ts_css
RTE.config.tt_content.bodytext.types.text.proc.overruleMode = ts_css
RTE.config.tt_content.bodytext.types.textpic.proc.overruleMode = ts_css
sven.​lauritzen ·

Nachdem mir auch die Seite abgeklappt ist, von der ich kopiert habe, habe ich's dann gelöst. Ich hatte nur eine "Kleinigkeit" umkonfiguriert, die mir vernünftig erschien, wusste dann aber auch nicht mehr, welche.

Ich habe dann folgenden Code in typo3_src/typo3/sysext/cms/tslib/class.tslib_content.php gefunden:

  /**
   * Implements the stdWrap property, "parseFunc".
   * This is a function with a lot of interesting uses. In classic TypoScript this is used to process text from the bodytext field; This included highlighting of search words, changing http:// and mailto: prefixed strings into links, parsing <typolist>, <typohead> and <typocode> tags etc.
   * It is still a very important function for processing of bodytext which is normally stored in the database in a format which is not fully ready to be outputted. This situation has not become better by having a RTE around...
   *
   * This function is actually just splitting the input content according to the configuration of "external blocks". This means that before the input string is actually "parsed" it will be splitted into the parts configured to BE parsed (while other parts/blocks should NOT be parsed). Therefore the actual processing of the parseFunc properties goes on in ->_parseFunc()
   *
   * @param string    The value to process.
   * @param array   TypoScript configuration for parseFunc
   * @param string    Reference to get configuration from. Eg. "< lib.parseFunc" which means that the configuration of the object path "lib.parseFunc" will be retrieved and MERGED with what is in $conf!
   * @return  string    The processed value
   * @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=327&cHash=33331f0396
   * @see _parseFunc()
   */
  function parseFunc($theValue, $conf, $ref='') {

Das schien mir eine passende Stelle zu sein, um mal zu gucken, was schiefgeht. Ich habe folgende Zeilen unterm Funktionskopf eingefügt:

echo "The value: $theValue\n";
echo "conf: ".print_r($conf,1)."\n";

... und siehe da, ich erhielt auf der Seite folgende Ausgabe:

The value: <typohead type="1">Testüberschrift&nbsp;</typohead type="1"> <typohead type="2">Testüberschrift l2</typohead type="2">
Testabsatz2
conf:

Außerdem wurde der "Nulla porta mollis sapien"-Text ausgegeben, den ich noch von der Installation auf der Seite habe, hier war $conf jedoch gefüllt. Das deutete ganz klar auf einen Zusammenhang mit css_styled_content hin. Ich habe die Extension mal unter "Include static (from extensions)" in der Template entfernt. Danach sah die Seite vernünftig aus.

Warum das so ist, ist mir jedoch nicht klar. Scheint so, dass css_styled_content so arbeitet, dass sauberes HTML in der Datenbank gespeichert wird. Aber das ist eine andere Geschichte und die erzählen wir beim nächsten Mal.

Gruß

Sven