Zum Inhalt springen

wrap <p class="bodytext"> ersetzten

Erstellt am 14. Mai 2004 · 3 Antworten · letzte Antwort am 25. Mai 2004

Tags: Frage

cduke ·

Hi typo3ler,

ich hoffe Ihr könnt mir helfen! Folgendes Problem - das ist das typo3-Script meiner Seite:

### Auto Template Parser ###
plugin.tx_automaketemplate_pi1 {
  content = FILE
  content.file = fileadmin/templates/page.html
  elements {
    BODY.all = 1
    BODY.all.subpartMarker = DOCUMENT_BODY
    HEAD.all = 1
    HEAD.all.subpartMarker = DOCUMENT_HEADER
    HEAD.rmTagSections = title
    TD.all = 1
  }
  relPathPrefix = fileadmin/templates/
}

### MENÜ ###
temp.menu = HMENU
temp.menu.1 = TMENU
temp.menu.1 {
  NO.allWrap = <div class="menu"> | </div>
  ACT = 1
  ACT.allWrap = <div class="menu_ON"> | </div>
}
 
# Main TEMPLATE cObject for the BODY
temp.mainTemplate = TEMPLATE
temp.mainTemplate {
  template =< plugin.tx_automaketemplate_pi1
  workOnSubpart = DOCUMENT_BODY
  subparts.MENU < temp.menu
  subparts.CONTENT < styles.content.get
}

# Default PAGE object:
page = PAGE
page.typeNum = 0
page.stylesheet = fileadmin/templates/style.css
page.10 < temp.mainTemplate

Wenn ich jetzt ein neues Content-Element auf der Seite anzeige wird es auch schön eingefügt. Dabei wird zB. der Bodytext-Teil mit <p class="bodytext"> | </p> eingefasst. Das ist zwar ganz nett - ich hätte aber viel lieber einen div Tag rundherum.

Über die Forumssuche und die Dokumentation bin ich auf folgendes gestoßen:

content.wrap.bodytext = <div class="content"> | </div>
styles.content.table.altWrap = |

Das habe ich in meine Constants eingefügt - es haut aber leider nicht hin. Typo3 fügt weiterhin seine <p...>-Tags ein. Weiß vielleicht jemand von Euch, was zu tun ist?

Danke für Eure Hilfe!

greetz cduke

FordPrefect ·

arbeitest du mit css_styled_content??
dann schreibe das ins Setup deines Templates:

lib.parseFunc_RTE < styles.content.parseFunc
lib.parseFunc_RTE {
nonTypoTagStdWrap.encapsLines {
encapsTagList = div,p,pre,h1,h2,h3,h4,h5,h6
remapTag.DIV = DIV
nonWrappedTag = DIV
innerStdWrap_all.ifEmpty = &nbsp;
addAttributes.DIV.class = bodytext
addAttributes.DIV.class.setOnly=blank
}
}

Gruss

Ford

FordPrefect ·

sry, nur das:

lib.parseFunc_RTE {
nonTypoTagStdWrap.encapsLines {
encapsTagList = div,p,pre,h1,h2,h3,h4,h5,h6
remapTag.DIV = DIV
nonWrappedTag = DIV
innerStdWrap_all.ifEmpty = &nbsp;
addAttributes.DIV.class = bodytext
addAttributes.DIV.class.setOnly=blank
}
}

cduke ·

Danke für Deine Antwort! Ich habe es einstweilen so gelöst:

### WRAP FÜR CONTENT-TEXT BEARBEITEN ###
tt_content.text.20.parseFunc {
 nonTypoTagStdWrap.encapsLines.nonWrappedTag >
 nonTypoTagStdWrap.encapsLines.wrapNonWrappedLines = |<br/>
}

Das ersetzt zumindest die <p>-Tags durch <br>. Deine Variante werde ich auch ausprobieren - mir gehts nämlich jetzt noch darum, den "bodytext"-Teil mit divs einzufassen, und zwar jeden Eintrag in "NORMAL" einzeln.

Vielen Dank nochmal!
greetz cduke