Zum Inhalt springen

Inhalt des bodytext-Feldes komplett wrappen

Erstellt am 4. April 2008 · 6 Antworten · letzte Antwort am 4. April 2008

Tags: Inhaltselemente, Frage

slobodan ·

Hallo zusammen,

Ich würde gerne alles, was im bodytext-Feld steht mit folgendem Code wrappen:

<div class="border">
  <div class="content_left">
    <div class="text"> [hier bodytext] </div>
  </div>
</div>

Habe folgenden TypoScript-Code in der Dokumentation gefunden. Wenn der Inhalt des bodytext-Felds nur einen Absatz (<p></p>) enthält, funktioniert das prima. Besteht der Text aus mehreren Absätzen, wird jeder einzelne Absatz gewrapped.

// Make sure nonTypoTagStdWrap operates on content outside <typolist> and <typohead> only:
tt_content.text.20.parseFunc.tags.typolist.breakoutTypoTagContent = 1
tt_content.text.20.parseFunc.tags.typohead.breakoutTypoTagContent = 1
// ... and no <br /> before typohead.
tt_content.text.20.parseFunc.tags.typohead.stdWrap.wrap >
// Setting up  nonTypoTagStdWrap to wrap the text with P-tags
tt_content.text.20.parseFunc.nonTypoTagStdWrap >
tt_content.text.20.parseFunc.nonTypoTagStdWrap.encapsLines {
  encapsTagList = div,p
  remapTag.DIV = P
  wrapNonWrappedLines = <div class="border"><div class="content_left"><div class="text">|</div></div></div>
 // Forcing these attributes onto the encapsulation-tags if any
  addAttributes.P {
    style=margin:0 0 0;
  }
  innerStdWrap_all.ifEmpty =  
  innerStdWrap_all.textStyle < tt_content.text.20.textStyle
}
// finally removing the old textstyle formatting on the whole bodytext part.
tt_content.text.20.textStyle >
// ... and <br />-tag after the content is not needed either...
tt_content.text.20.wrap >

Hat jemand eine Idee, wie man das hinbekommt?

Gruß & Danke

Slobodan

slobodan ·
Tante Jensen schrieb

Hi,

wenn es immer sein soll, warum schreibst du den Kram nicht einfach ins HTML-Template?

Hi Tante Jensen,

da ich jedes Content-Element einer Seite damit wrappen möchte, kann ich es nicht ins HTML-Template schreiben.
Wenn das so einfach wäre... 😉

Danke & Gruß

Slobodan

just2b ·

vermutlich gehts einfacher auch

# Wrap of content in colPos = LEFT & RIGHT
tt_content.textpic {
	15 = CASE
	15 {
		key.field=colPos
		1 = TEXT
		1.value = <div class="bg"><div class="bg2">
		2 <.1
	}
	25 = CASE
	25 {
		key.field=colPos
		1 = TEXT
		1.value = </div></div>
		2 <.1
	}
}
tt_content.menu.15 < tt_content.textpic.15
tt_content.menu.25 < tt_content.textpic.25

tt_content.list.15 < tt_content.textpic.15
tt_content.list.25 < tt_content.textpic.25

tt_content.kb_nescefe_pi1.15 < tt_content.textpic.15
tt_content.kb_nescefe_pi1.25 < tt_content.textpic.25

sowas hab ich mal ca gemacht

georg

slobodan ·

Hi Georg,

Danke für die schnelle Antwort. Aber wenn ich das richtig sehe, wird in Deinem Beispiel der ganze Content einer Spalte gewrapped.

Ich möchte lediglich den Inhalt des bodytext aus der Eingabemaske im BE wrappen. die Überschrift habe ich schon über den wrap des stdheader's formatiert.

Mich wundert, dass ich zu dieser Problematik bisher nichts gefunden habe. Vielleicht ist die Lösung aber auch total einfach und ich sehe den Wald vor lauter Bäumen nicht mehr.

Danke & Grüße

Slobodan

slobodan ·
slobodan schrieb

Ich möchte lediglich den Inhalt des bodytext aus der Eingabemaske im BE wrappen. die Überschrift habe ich schon über den wrap des stdheader's formatiert.

Vielleicht sollte ich nur mal richtig lesen ... der Lösungsansatz ist goldrichtig!!! :o

Besten Dank

Slobodan