views:

33

answers:

1

Hi,

I've got a strange problem connected with content rendering.

I use following code to grab the content:

lib.otherContent = CONTENT
lib.otherContent {
  table = tt_content
  select {
    pidInList = this
    orderBy = sorting
    where = colPos=0
    languageField = sys_language_uid
  }

  renderObj = COA
  renderObj {
    10 = TEXT
    10.field = header
    10.wrap = <h2>|</h2>
    20 = TEXT
    20.field = bodytext
    20.wrap = <div class="article">|</div>
  } 
}

and everything works fine, except that I'd like to use also predefined column-content templates other than simple text (Text with image, Images only, Bullet list etc.).

The question is: with what I have to replace renderObj = COA and the rest between the brackets to let the typo3 display it properly?

Thanks, I.

A: 

The available cObjects are more or less listed in TSRef, chapter 8.

TypoScript for rendering Text w/image can be found in typo3/sysext/css_styled_content/static/v4.3/setup.txt at line 724, and in the neighborhood you'll find e.g. bullets (below) and image (above), which is referenced in textpic line 731. Variants of this is what you'll write in your renderObj.

You will find more details in the file typo3/sysext/cms/tslib/class.tslib_content.php, where e.g. text w/image is found at or around line 897 and is called IMGTEXT (do a case-sensitive search). See also around line 403 in typo3/sysext/css_styled_content/pi1/class.cssstyledcontent_pi1.php, where the newer css-based rendering takes place.

norwebian
thanks norwebian, it clears a lot.
Ireneusz Sawicki
So there isn't any automagically way to render content column? For example (if I've got one subpage with content defined as IMGTEXT, BULLET, TABLE and the second TABLE, BULLET) a piece of code which would render IMGTEXT then BULLET then TABLE, and on the other subpage TABLE then BULLET? And I should write different TS for every subpage with different content layout?
Ireneusz Sawicki
If you simply want to render the column flat out without any manipulation of the rendering, you simply omit the definition of renderObj and let TYPO3 do its thing. No TEXT, no further curly braces. Simply table = .. and select {...}.
norwebian
That's strange - if I grab the content in the way you said (without renderObj) I've got no content rendered on the page.I'm using following TS to put the content to template:marks.CONTENT < lib.otherContent
Ireneusz Sawicki
You might try assigning renderObj its should-be-default-value [renderObj = < tt_content] (cf TSREf chapter 8.9). At least I am able to manipulate (show/no show) the result through this setting in my installation. But to me it also works without it, of course. Try it anyways! Hope this helps. :-)
norwebian
Just a thought, by the way: You do have one of the "CSS styled content" static files included in your template record? I just did a few tests, and without the CSC file (I use the one for v4.3) I get the problem you seem to be describing. It needs to be in the left pane under the Include tab.
norwebian
norwebian, You rule!
Ireneusz Sawicki
Problem was with the lack of include, solved and I owe you a beer. :-)
Ireneusz Sawicki
:-) My pleasure.
norwebian