[Typo3] wrap content header with table instead of h1 tag

Jacob Floyd techgurufloyd at gmail.com
Thu Jun 16 00:59:48 CEST 2005


Sadly, that doesn't seem to work. Why? I haven't a clue.

I've been searching around and I know what TS renders the elements but
I'm not sure how to change the rendering.

I'm trying to wrap my head around all this and figure out how to
bypass the lib.stdheader stuff, and render it myself, but I've not
come up with much. However, looking at the problems I've had in the
past, the solution is probably staring me in the face. I just don't
see it yet.

I tried 2 things like what Tyler suggested

styles.content.getLeft.wrap = TESTING | TESTING
  #wraps as expected

styles.content.getLeft.wrap = <table width="95%"  border="0"
cellpadding="1" cellspacing="0"> | </table><br />
  #Nothing is wrapped!

styles.content.getLeft.wrap = table width="95%"  border="0"
cellpadding="1" cellspacing="0"> | /table>br />
  #wraps as expected
  #Note the removal of the beginning <

based on that I'd have to say that somewhere something is stripping
all the HTML tags. but where? and how do I get around it.

I also played around with the renderObj in the suggested code:

#################
# wrap right content
#################
temp.contentRightRepeat = CONTENT
temp.contentRightRepeat {
table = tt_content
select {
pidInList = this
where = colpos=2
}
renderObj.20 = TEXT
renderObj.20.field = header
renderObj.20.wrap = <td class="header">|<td>
renderObj.21 = TEXT
renderObj.21.field = bodytext
renderObj.21.wrap = <td class="blabala">|<td>
renderObj.stdWrap.wrap = <table border=0 ><tr> | </tr></table>
}

but the cObjects 20 and 21 don't seem to do anything. stdWrap seems to
work (as long as the < is removed. It won't work for HTML tags)

Also, after digging a little bit, the TS that renders all of the
content elements in the CSS_styled_content extension is:

...
# Content header:
lib.stdheader = COA
lib.stdheader {

	# Create align style-attribute for <Hx> tags
	2 = LOAD_REGISTER
	2.headerStyle.field = header_position
	2.headerStyle.required = 1
	2.headerStyle.noTrimWrap = | style="text-align:|;"|

	# Create class="csc-firstHeader" attribute for <Hx> tags
	3 = LOAD_REGISTER
	3.headerClass = csc-firstHeader
	3.headerClass.if.value=1
	3.headerClass.if.equals.data = cObj:parentRecordNumber
	3.headerClass.noTrimWrap = | class="|"|

	# Date format:
	5 = TEXT
	5.field = date
	5.if.isTrue.field = date
	5.date = d/m Y
	5.wrap = <p class="csc-header-date">|</p>
	5.prefixComment = 2 | Header date:

	# This CASE cObject renders the header content:
	# currentValue is set to the header data, possibly wrapped in link-tags.
	10 = CASE
	10.setCurrent {
		field = header
		htmlSpecialChars = 1
		typolink.parameter.field = header_link
	}
	10.key.field = header_layout
	10.key.ifEmpty = {$content.defaultHeaderType}
	10.key.ifEmpty.override.data = register: defaultHeaderType

	10.1 = TEXT
	10.1.current = 1
	10.1.insertData = 1
	10.1.fontTag = <h1{register:headerStyle}{register:headerClass}>|</h1>

	10.2 < .10.1
	10.2.fontTag = <h2{register:headerStyle}{register:headerClass}>|</h2>

	10.3 < .10.1
	10.3.fontTag = <h3{register:headerStyle}{register:headerClass}>|</h3>

	10.4 < .10.1
	10.4.fontTag = <h4{register:headerStyle}{register:headerClass}>|</h4>

	10.5 < .10.1
	10.5.fontTag = <h5{register:headerStyle}{register:headerClass}>|</h5>

	# Post-processing:
	stdWrap.fieldRequired = header
	stdWrap.if {
		equals.field = header_layout
		value = 100
		negate = 1
	}

	stdWrap.editIcons = tt_content : header, [header_layout |
header_position], [header_link|date]
	stdWrap.editIcons.beforeLastTag = 1
	stdWrap.editIcons.iconTitle.data =
LLL:EXT:css_styled_content/pi1/locallang.php:eIcon.header

	stdWrap.dataWrap = <div class="csc-header
csc-header-n{cObj:parentRecordNumber}">|</div>
	stdWrap.prefixComment = 2 | Header:
}
...
# *****************
# CType: text
# *****************
tt_content.text = COA
tt_content.text {
	10 = < lib.stdheader

	20 = TEXT
	20 {
		field = bodytext
		required = 1

		parseFunc = < lib.parseFunc_RTE

		editIcons = tt_content:bodytext, rte_enabled
		editIcons.beforeLastTag = 1
		editIcons.iconTitle.data =
LLL:EXT:css_styled_content/pi1/locallang.php:eIcon.bodytext

		prefixComment = 2 | Text:
	}
}

Thanks for all your help so far.
Jacob Floyd



More information about the TYPO3-english mailing list