[TYPO3-RTE] Table in Unordered List

Uschi Renziehausen typo3news at otherone.de
Sat Nov 29 14:35:12 CET 2008


Hi Marcus and Tapio,

>>
>> is it possible to have a table within a list element. Right now the
>> table looks ok in the rte and the database. But in the FE it is rendered
>> as html source.

Definitely yes, as it works in my installation :-) I can have tables 
inside lists and the other way round. Here is my adaptation of 
lib.parseFunc_RTE:

lib.parseFunc_RTE < lib.parseFunc
lib.parseFunc_RTE {
	//  makelinks >

	# @description Parse certain block elements seperately
	externalBlocks = table, blockquote, ol,ul, div, dl, dd
	externalBlocks {
		# The blockquote content is passed into parseFunc again...
		blockquote.stripNL=1
		blockquote.callRecursive=1
		blockquote.callRecursive.tagStdWrap.HTMLparser = 1

		div.stripNL=1
		div.callRecursive = 1
		
		dl.stripNL=1
		dl.callRecursive = 1
		
		dd.stripNL=1
		dd.callRecursive = 1
		
		ol.stripNL=1
		ol.stdWrap.parseFunc = < lib.parseFunc

		ul.stripNL=1
		ul.stdWrap.parseFunc = < lib.parseFunc

		table.stripNL=1
		table.stdWrap.HTMLparser = 1


		table.stdWrap.HTMLparser.keepNonMatchedTags = 1
		# Do NOT add any unwanted p elements in table cells, and do NOT remove 
any p-elements that have been added by authors!	
		table.HTMLtableCells=1
		table.HTMLtableCells.default.stdWrap.parseFunc =< lib.parseFunc
	}
	nonTypoTagStdWrap.encapsLines {
		encapsTagList = div,p,pre,h1,h2,h3,h4,h5,h6,dt,hr
		nonWrappedTag = P
		innerStdWrap_all.ifBlank = &nbsp;

	}
	nonTypoTagStdWrap.HTMLparser = 1
	nonTypoTagStdWrap.HTMLparser {
		keepNonMatchedTags = 1
		htmlSpecialChars = 2
	}
}

>>
> source of the problem is apparently 'externalBlocks' in DB > FE 
> transformation. apparently the reason is that table and ul/li has been 
> handled as externalblock.
> 

Hmmm, but if ol,ul etc. are not handled externa blocks, they cannot be 
parsed recursively, so you will end up with links and other stuff inside 
     ol,ul,td etc. not rendered correctly. And anyways, you can define 
which parseFunc is responsible for which element.

Not that I really understand what is going on in these transformations, 
at least I do not anymore, but the above adaptation works fine for me.

Prosit, Uschi


More information about the TYPO3-project-rte mailing list