[TYPO3] Retrieving RECORD bodycontent via TS?

Jason A. Lefkowitz jason at jasonlefkowitz.net
Thu Mar 22 20:38:20 CET 2007


Christopher Torgalson wrote:

> If you mean the example below, then NO it does NOT use the syntax used
> in your first message

I wasn't citing it as an example of my syntax, I was citing it because 
Tyler's response was "you are dumb to even be using the RECORDS cObject 
for this."  Which TSByEx disagrees with.  Which is why I resented the 
"go read the documentation" treatment.

I actually spent a good chunk of time this morning trying to adapt the 
very syntax from TSByEx you cite to solve my problem.  However, it works 
for just bringing back the text of the content element, but you lose all 
the embedded markup (because it's being rendered by a TEXT cObject I 
assume).

If you change it to something like this:

lib.contentGoesHere = RECORDS
lib.contentGoesHere.source = 1
lib.contentGoesHere.tables = tt_content
lib.contentGoesHere.conf.tt_content = HTML
lib.contentGoesHere.conf.tt_content {

    field = bodytext

}

... it fails, because the HTML cObject does not get stdWrap on its root 
level and thus does not have a "field" property.

Given that the HTML cObject only has stdWrap through the "value" 
property, it seemed logical that this might work instead:

lib.contentGoesHere = RECORDS
lib.contentGoesHere.source = 1
lib.contentGoesHere.tables = tt_content
lib.contentGoesHere.conf.tt_content = HTML
lib.contentGoesHere.conf.tt_content {

    value.field = bodytext

}

... but it doesn't -- you get the bodytext back, but not the markup. 
(Setting value.stripHtml = 0 doesn't help, either.)  After hitting that 
wall I gave up on the syntax in TSByEx and went looking in other places 
instead.

So, if there is a way to use the syntax in TSByEx to retrieve the 
bodytext with its markup, please enlighten me.  But don't assume I can't 
copy and paste.

-- Jason Lefkowitz


More information about the TYPO3-english mailing list